diff options
author | Rolf Eike Beer <eike@sf-mail.de> | 2020-03-20 17:05:24 (GMT) |
---|---|---|
committer | Rolf Eike Beer <eike@sf-mail.de> | 2020-03-23 21:41:43 (GMT) |
commit | 48adc297211181a97fab75ef0260fda5147c1195 (patch) | |
tree | 17f278522ccaff4b03bc1eb81cb5177fd42d0f37 /Source/cmcmd.cxx | |
parent | bfb69f9543bfa7f9f3c9488bf7e740f21896cec4 (diff) | |
download | CMake-48adc297211181a97fab75ef0260fda5147c1195.zip CMake-48adc297211181a97fab75ef0260fda5147c1195.tar.gz CMake-48adc297211181a97fab75ef0260fda5147c1195.tar.bz2 |
replace "std::string::find(x) == 0" with cmHasPrefix()
Diffstat (limited to 'Source/cmcmd.cxx')
-rw-r--r-- | Source/cmcmd.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index 8f619b1..08543a9 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -1510,7 +1510,7 @@ int cmcmd::ExecuteEchoColor(std::vector<std::string> const& args) bool newline = true; std::string progressDir; for (auto const& arg : cmMakeRange(args).advance(2)) { - if (arg.find("--switch=") == 0) { + if (cmHasLiteralPrefix(arg, "--switch=")) { // Enable or disable color based on the switch value. std::string value = arg.substr(9); if (!value.empty()) { @@ -1565,7 +1565,7 @@ int cmcmd::ExecuteLinkScript(std::vector<std::string> const& args) // args[3] == --verbose=? bool verbose = false; if (args.size() >= 4) { - if (args[3].find("--verbose=") == 0) { + if (cmHasLiteralPrefix(args[3], "--verbose=")) { if (!cmIsOff(args[3].substr(10))) { verbose = true; } @@ -1825,7 +1825,7 @@ int cmcmd::VisualStudioLink(std::vector<std::string> const& args, int type) std::vector<std::string> expandedArgs; for (std::string const& i : args) { // check for nmake temporary files - if (i[0] == '@' && i.find("@CMakeFiles") != 0) { + if (i[0] == '@' && !cmHasLiteralPrefix(i, "@CMakeFiles")) { cmsys::ifstream fin(i.substr(1).c_str()); std::string line; while (cmSystemTools::GetLineFromStream(fin, line)) { |