summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
diff options
context:
space:
mode:
authorDaniel Pfeifer <daniel@pfeifer-mail.de>2016-05-24 19:24:10 (GMT)
committerDaniel Pfeifer <daniel@pfeifer-mail.de>2016-05-24 21:22:24 (GMT)
commit5784747d1b0404a0c1cb0223b15b823476023fba (patch)
tree763d07bbde561ad1a2322328764b93b6c1852db2 /Source/cmLocalGenerator.cxx
parent5cec953e6aafd4c132a7b6c0a929d95c1dee79ea (diff)
downloadCMake-5784747d1b0404a0c1cb0223b15b823476023fba.zip
CMake-5784747d1b0404a0c1cb0223b15b823476023fba.tar.gz
CMake-5784747d1b0404a0c1cb0223b15b823476023fba.tar.bz2
Improve string find: prefer character overloads.
Apply fix-its from clang-tidy's performance-faster-string-find checker. Ignore findings in kwsys.
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r--Source/cmLocalGenerator.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 4a52f51..2648bf4 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -640,7 +640,7 @@ std::string cmLocalGenerator::ExpandRuleVariable(
if (variable == "TARGET_BASE") {
// Strip the last extension off the target name.
std::string targetBase = replaceValues.Target;
- std::string::size_type pos = targetBase.rfind(".");
+ std::string::size_type pos = targetBase.rfind('.');
if (pos != targetBase.npos) {
return targetBase.substr(0, pos);
} else {
@@ -2306,7 +2306,7 @@ std::string& cmLocalGenerator::CreateSafeUniqueObjectFileName(
std::string ssin = sin;
// Avoid full paths by removing leading slashes.
- ssin.erase(0, ssin.find_first_not_of("/"));
+ ssin.erase(0, ssin.find_first_not_of('/'));
// Avoid full paths by removing colons.
std::replace(ssin.begin(), ssin.end(), ':', '_');
@@ -2464,7 +2464,7 @@ std::string cmLocalGenerator::GetObjectFileNameWithoutTarget(
// Remove the source extension if it is to be replaced.
if (replaceExt) {
keptSourceExtension = false;
- std::string::size_type dot_pos = objectName.rfind(".");
+ std::string::size_type dot_pos = objectName.rfind('.');
if (dot_pos != std::string::npos) {
objectName = objectName.substr(0, dot_pos);
}
@@ -2603,7 +2603,7 @@ bool cmLocalGenerator::CheckDefinition(std::string const& define) const
}
// Many compilers do not support # in the value so we disable it.
- if (define.find_first_of("#") != define.npos) {
+ if (define.find_first_of('#') != define.npos) {
std::ostringstream e;
/* clang-format off */
e << "WARNING: Preprocessor definitions containing '#' may not be "