summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-01-15 21:58:10 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-01-18 13:25:25 (GMT)
commitfd0c036c0c3e5e6be685e64caecdcbad4b3e744c (patch)
tree98e33d676ae86721e70d74ad2ed4c31b723e6cbe
parentf09fde2d21ef0c97f0ed1b8c6849f0d7055bc24e (diff)
downloadCMake-fd0c036c0c3e5e6be685e64caecdcbad4b3e744c.zip
CMake-fd0c036c0c3e5e6be685e64caecdcbad4b3e744c.tar.gz
CMake-fd0c036c0c3e5e6be685e64caecdcbad4b3e744c.tar.bz2
Replace 'foo.length() >= 1' pattern with !foo.empty()
-rw-r--r--Source/cmFileCommand.cxx2
-rw-r--r--Source/cmake.cxx2
2 files changed, 2 insertions, 2 deletions
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index aab256a..2c92db2 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -745,7 +745,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector<std::string> const& args)
// A non-string character has been found. Check if the current
// string matches the requirements. We require that the length
// be at least one no matter what the user specified.
- if(s.length() >= minlen && s.length() >= 1 &&
+ if(s.length() >= minlen && !s.empty() &&
(!have_regex || regex.find(s.c_str())))
{
output_size += static_cast<int>(s.size()) + 1;
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 7accec2..29d8206 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -2531,7 +2531,7 @@ static bool cmakeCheckStampFile(const char* stampName)
while(cmSystemTools::GetLineFromStream(fin, dep))
{
int result;
- if(dep.length() >= 1 && dep[0] != '#' &&
+ if(!dep.empty() && dep[0] != '#' &&
(!ftc.FileTimeCompare(stampDepends.c_str(), dep.c_str(), &result)
|| result < 0))
{