Codechange: use std::string without const as return

Otherwise some compilers, e.g. MSVC, do not pick up that these are temporaries
and as such it will pass the temporaries to `const std::string &` instead of
the wanted `std::string &&`
This commit is contained in:
Rubidium
2023-07-03 16:22:15 +02:00
committed by rubidium42
parent b2edf82b69
commit 78f5d58dc6
5 changed files with 15 additions and 15 deletions

View File

@@ -26,7 +26,7 @@ public:
* @return A string.
* @api -all
*/
virtual const std::string GetEncodedText() = 0;
virtual std::string GetEncodedText() = 0;
/**
* Convert a #ScriptText into a decoded normal string.
@@ -44,7 +44,7 @@ class RawText : public Text {
public:
RawText(const std::string &text);
const std::string GetEncodedText() override { return this->text; }
std::string GetEncodedText() override { return this->text; }
private:
const std::string text;
};
@@ -125,7 +125,7 @@ public:
/**
* @api -all
*/
virtual const std::string GetEncodedText();
virtual std::string GetEncodedText();
private:
using ScriptTextRef = ScriptObjectRef<ScriptText>;