Fix clang-tidy performance-faster-string-find warnings

This commit is contained in:
Tim Wojtulewicz 2025-04-25 13:42:33 -07:00
parent f4c47d0357
commit 178d7f4cd0
2 changed files with 2 additions and 1 deletions

View file

@ -2,6 +2,7 @@ Checks: [-*,
bugprone-*, bugprone-*,
performance-avoid-endl, performance-avoid-endl,
performance-enum-size, performance-enum-size,
performance-faster-string-find,
# Skipping these temporarily because they are very noisy # Skipping these temporarily because they are very noisy
-bugprone-narrowing-conversions, -bugprone-narrowing-conversions,

View file

@ -158,7 +158,7 @@ string CPPCompile::CaptureName(const ID* c) const {
// We want to strip both the module and any inlining appendage. // We want to strip both the module and any inlining appendage.
auto tn = trim_name(c); auto tn = trim_name(c);
auto appendage = tn.find("."); auto appendage = tn.find('.');
if ( appendage != string::npos ) if ( appendage != string::npos )
tn.erase(tn.begin() + appendage, tn.end()); tn.erase(tn.begin() + appendage, tn.end());