Interval: We can return a const reference to tags.

Interval is already marked as a constant object here and we can eliminate
creating unnecessary copies when filtering large databases.

Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
This commit is contained in:
Shaun Ruffell 2020-03-05 17:49:24 -06:00 committed by lauft
parent c1f3d8be72
commit b62b7b3435
2 changed files with 2 additions and 2 deletions

View file

@ -69,7 +69,7 @@ bool Interval::hasTag (const std::string& tag) const
}
////////////////////////////////////////////////////////////////////////////////
std::set <std::string> Interval::tags () const
const std::set <std::string>& Interval::tags () const
{
return _tags;
}

View file

@ -41,7 +41,7 @@ public:
bool empty () const;
bool hasTag (const std::string&) const;
std::set <std::string> tags () const;
const std::set <std::string>& tags () const;
void tag (const std::string&);
void untag (const std::string&);