Make firstLine() return reference not value

And make return const to prevent _firstLine being
mutable.

Signed-off-by: NickWingate <nicholas.wingate03@gmail.com>
Change-Id: I1a6e391cd128704b67ec5cc99a4ed4d105f64e29
This commit is contained in:
NickWingate 2021-08-27 16:02:24 +01:00 committed by Michael Meeks
parent cc58c79136
commit e72b073090

View file

@ -75,7 +75,7 @@ public:
bool firstTokenMatches(const std::string& target) const { return _tokens[0] == target; }
std::string operator[](size_t index) const { return _tokens[index]; }
std::string firstLine()
const std::string& firstLine()
{
if (_firstLine.empty())
{