From 178d7f4cd02428695a5feb0306ed84d360898962 Mon Sep 17 00:00:00 2001 From: Tim Wojtulewicz Date: Fri, 25 Apr 2025 13:42:33 -0700 Subject: [PATCH] Fix clang-tidy performance-faster-string-find warnings --- .clang-tidy | 1 + src/script_opt/CPP/Vars.cc | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.clang-tidy b/.clang-tidy index 215b5a5e26..f3381a7b75 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -2,6 +2,7 @@ Checks: [-*, bugprone-*, performance-avoid-endl, performance-enum-size, + performance-faster-string-find, # Skipping these temporarily because they are very noisy -bugprone-narrowing-conversions, diff --git a/src/script_opt/CPP/Vars.cc b/src/script_opt/CPP/Vars.cc index 893a1231a0..62888c6ee1 100644 --- a/src/script_opt/CPP/Vars.cc +++ b/src/script_opt/CPP/Vars.cc @@ -158,7 +158,7 @@ string CPPCompile::CaptureName(const ID* c) const { // We want to strip both the module and any inlining appendage. auto tn = trim_name(c); - auto appendage = tn.find("."); + auto appendage = tn.find('.'); if ( appendage != string::npos ) tn.erase(tn.begin() + appendage, tn.end());