diff options
author | Daniel Pfeifer <daniel@pfeifer-mail.de> | 2016-05-24 19:24:10 (GMT) |
---|---|---|
committer | Daniel Pfeifer <daniel@pfeifer-mail.de> | 2016-05-24 21:22:24 (GMT) |
commit | 5784747d1b0404a0c1cb0223b15b823476023fba (patch) | |
tree | 763d07bbde561ad1a2322328764b93b6c1852db2 /Source/CPack | |
parent | 5cec953e6aafd4c132a7b6c0a929d95c1dee79ea (diff) | |
download | CMake-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/CPack')
-rw-r--r-- | Source/CPack/IFW/cmCPackIFWPackage.cxx | 6 | ||||
-rw-r--r-- | Source/CPack/cpack.cxx | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/Source/CPack/IFW/cmCPackIFWPackage.cxx b/Source/CPack/IFW/cmCPackIFWPackage.cxx index df612e5..ad153d1 100644 --- a/Source/CPack/IFW/cmCPackIFWPackage.cxx +++ b/Source/CPack/IFW/cmCPackIFWPackage.cxx @@ -56,13 +56,13 @@ cmCPackIFWPackage::DependenceStruct::DependenceStruct( } else if ((pos = dependence.find(">=")) != std::string::npos) { Compare.Type = CompareGreaterOrEqual; Compare.Value = dependence.substr(pos + 2); - } else if ((pos = dependence.find("<")) != std::string::npos) { + } else if ((pos = dependence.find('<')) != std::string::npos) { Compare.Type = CompareLess; Compare.Value = dependence.substr(pos + 1); - } else if ((pos = dependence.find("=")) != std::string::npos) { + } else if ((pos = dependence.find('=')) != std::string::npos) { Compare.Type = CompareEqual; Compare.Value = dependence.substr(pos + 1); - } else if ((pos = dependence.find(">")) != std::string::npos) { + } else if ((pos = dependence.find('>')) != std::string::npos) { Compare.Type = CompareGreater; Compare.Value = dependence.substr(pos + 1); } diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx index e54be2c..10f60b2 100644 --- a/Source/CPack/cpack.cxx +++ b/Source/CPack/cpack.cxx @@ -68,7 +68,7 @@ int cpackDefinitionArgument(const char* argument, const char* cValue, (void)argument; cpackDefinitions* def = static_cast<cpackDefinitions*>(call_data); std::string value = cValue; - size_t pos = value.find_first_of("="); + size_t pos = value.find_first_of('='); if (pos == std::string::npos) { cmCPack_Log(def->Log, cmCPackLog::LOG_ERROR, "Please specify CPack definitions as: KEY=VALUE" << std::endl); |