Fix incorrect comment in hiliteMatches

This commit is contained in:
Fishhh 2022-06-05 18:44:37 +02:00
parent 1dd7253133
commit d137ceccef
No known key found for this signature in database
GPG key ID: FDB7055C732D177D

View file

@ -8,9 +8,9 @@ std::string hiliteMatches(
std::string_view prefix,
std::string_view postfix)
{
// Avoid copy on zero matches
// Avoid extra work on zero matches
if (matches.size() == 0)
return (std::string) s;
return std::string(s);
std::sort(matches.begin(), matches.end(), [](const auto & a, const auto & b) {
return a.position() < b.position();