Don't return a const std::string from GetData

It has zero benefit and forces an extra copy.
This commit is contained in:
Thomas Goyne 2014-03-07 16:30:20 -08:00
parent e64fd78c51
commit 8acce1a9ee
5 changed files with 5 additions and 5 deletions

View file

@ -46,7 +46,7 @@ public:
/// @param raw If false, remove the SSA filename mangling
std::string GetFileName(bool raw=false) const;
const std::string GetEntryData() const override { return entry_data; }
std::string GetEntryData() const override { return entry_data; }
AssEntryGroup Group() const override { return group; }
AssAttachment *Clone() const override { return new AssAttachment(*this); }

View file

@ -170,7 +170,7 @@ public:
/// Update the text of the line from parsed blocks
void UpdateText(boost::ptr_vector<AssDialogueBlock>& blocks);
const std::string GetEntryData() const override { return GetData(false); }
std::string GetEntryData() const override { return GetData(false); }
/// Get the line as SSA rather than ASS
std::string GetSSAText() const override { return GetData(true); }

View file

@ -60,7 +60,7 @@ public:
std::string const& GroupHeader(bool ssa=false) const;
/// @brief Get this line's raw entry data in ASS format
virtual const std::string GetEntryData() const=0;
virtual std::string GetEntryData() const=0;
/// Get this line in SSA format
virtual std::string GetSSAText() const { return GetEntryData(); }

View file

@ -28,7 +28,7 @@ public:
AssInfo *Clone() const override { return new AssInfo(*this); }
AssEntryGroup Group() const override { return AssEntryGroup::INFO; }
const std::string GetEntryData() const override { return key + ": " + value; }
std::string GetEntryData() const override { return key + ": " + value; }
std::string GetSSAText() const override { return boost::iequals(key, "scripttype: v4.00+") ? "ScriptType: v4.00" : GetEntryData(); }
std::string Key() const { return key; }

View file

@ -77,7 +77,7 @@ public:
AssStyle();
AssStyle(std::string const& data, int version=1);
const std::string GetEntryData() const override { return data; }
std::string GetEntryData() const override { return data; }
std::string GetSSAText() const override;
AssEntryGroup Group() const override { return AssEntryGroup::STYLE; }
AssStyle *Clone() const override { return new AssStyle(*this); }