diff options
| author | Herman Semenoff <GermanAizek@yandex.ru> | 2026-04-08 11:37:24 +0300 |
|---|---|---|
| committer | Herman Semenoff <GermanAizek@yandex.ru> | 2026-04-08 11:37:24 +0300 |
| commit | af5b9453a1908021cf75c348522c1a12eeb0dee4 (patch) | |
| tree | e5d3d569e51d24207eb0228615f5eedd37e08296 /apt-private/private-source.cc | |
| parent | 04dcfd52355ca06143a8aaca4afd718a22fb0ded (diff) | |
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
Diffstat (limited to 'apt-private/private-source.cc')
| -rw-r--r-- | apt-private/private-source.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/apt-private/private-source.cc b/apt-private/private-source.cc index ebd3a980c..eb7eee931 100644 --- a/apt-private/private-source.cc +++ b/apt-private/private-source.cc @@ -86,21 +86,21 @@ static pkgSrcRecords::Parser *FindSrc(const char *Name, TmpSrc = TmpSrc.substr(4); } // extract release - size_t found = TmpSrc.find_last_of("/"); + size_t found = TmpSrc.find_last_of('/'); if (found != std::string::npos) { RelTag = TmpSrc.substr(found+1); TmpSrc = TmpSrc.substr(0,found); } // extract the version - found = TmpSrc.find_last_of("="); + found = TmpSrc.find_last_of('='); if (found != std::string::npos) { VerTag = UserRequestedVerTag = TmpSrc.substr(found+1); TmpSrc = TmpSrc.substr(0,found); } // extract arch - found = TmpSrc.find_last_of(":"); + found = TmpSrc.find_last_of(':'); if (found != std::string::npos) { ArchTag = TmpSrc.substr(found+1); @@ -359,14 +359,14 @@ bool DoSource(CommandLine &CmdL) while (pos != std::string::npos) { pos += strlen("\nVcs-"); - std::string vcs = srec.substr(pos,srec.find(":",pos)-pos); + std::string vcs = srec.substr(pos,srec.find(':',pos)-pos); if(vcs == "Browser") { pos = srec.find("\nVcs-", pos); continue; } pos += vcs.length()+2; - std::string::size_type epos = srec.find("\n", pos); + std::string::size_type epos = srec.find('\n', pos); std::string const uri = srec.substr(pos,epos-pos); ioprintf(c1out, _("NOTICE: '%s' packaging is maintained in " "the '%s' version control system at:\n" @@ -806,7 +806,7 @@ bool DoBuildDep(CommandLine &CmdL) WriteBuildDependencyPackage(buildDepsPkgFile, pseudo, pseudoArch, GetBuildDeps(Last, Src.c_str(), hostArch)); std::string reltag = *I; - size_t found = reltag.find_last_of("/"); + size_t found = reltag.find_last_of('/'); if (found == std::string::npos) reltag.clear(); else |
