From af5b9453a1908021cf75c348522c1a12eeb0dee4 Mon Sep 17 00:00:00 2001 From: Herman Semenoff Date: Wed, 8 Apr 2026 11:37:24 +0300 Subject: apt: funcs called with a string literal consisting of a single character Benchmark: - https://stackoverflow.com/questions/62058906/why-my-performance-benchmark-gives-me-wrong-results References: - https://clang.llvm.org/extra/clang-tidy/checks/performance/prefer-single-char-overloads.html --- apt-pkg/contrib/strutl.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'apt-pkg/contrib') diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc index b5200831a..4363ab818 100644 --- a/apt-pkg/contrib/strutl.cc +++ b/apt-pkg/contrib/strutl.cc @@ -840,7 +840,7 @@ std::string LookupTag(const std::string &Message, const char *TagC, const char * // skip the space leading a multiline (Keep all other whitespaces in the value) valuestart = std::next(valuestart); } - auto const valueend = result.find_last_not_of("\n"); + auto const valueend = result.find_last_not_of('\n'); if (valueend == std::string::npos) result.clear(); else @@ -1506,7 +1506,7 @@ char *safe_snprintf(char *Buffer,char *End,const char *Format,...) // --------------------------------------------------------------------- string StripEpoch(const string &VerStr) { - size_t i = VerStr.find(":"); + size_t i = VerStr.find(':'); if (i == string::npos) return VerStr; return VerStr.substr(i+1); -- cgit v1.2.3-70-g09d2