clang-tidy: use '' for single character find
Found with performance-faster-string-find Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
@@ -1533,7 +1533,7 @@ void CLI2::findIDs ()
|
||||
for (auto& element : elements)
|
||||
{
|
||||
changes = true;
|
||||
auto hyphen = element.find ("-");
|
||||
auto hyphen = element.find ('-');
|
||||
if (hyphen != std::string::npos)
|
||||
_id_ranges.push_back (std::pair <std::string, std::string> (element.substr (0, hyphen), element.substr (hyphen + 1)));
|
||||
else
|
||||
@@ -1588,7 +1588,7 @@ void CLI2::findIDs ()
|
||||
for (const auto& element : elements)
|
||||
{
|
||||
changes = true;
|
||||
auto hyphen = element.find ("-");
|
||||
auto hyphen = element.find ('-');
|
||||
if (hyphen != std::string::npos)
|
||||
_id_ranges.push_back (std::pair <std::string, std::string> (element.substr (0, hyphen), element.substr (hyphen + 1)));
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user