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:
parent
cc58c79136
commit
e72b073090
1 changed files with 1 additions and 1 deletions
|
@ -75,7 +75,7 @@ public:
|
||||||
bool firstTokenMatches(const std::string& target) const { return _tokens[0] == target; }
|
bool firstTokenMatches(const std::string& target) const { return _tokens[0] == target; }
|
||||||
std::string operator[](size_t index) const { return _tokens[index]; }
|
std::string operator[](size_t index) const { return _tokens[index]; }
|
||||||
|
|
||||||
std::string firstLine()
|
const std::string& firstLine()
|
||||||
{
|
{
|
||||||
if (_firstLine.empty())
|
if (_firstLine.empty())
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue