From fd0c036c0c3e5e6be685e64caecdcbad4b3e744c Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 15 Jan 2015 22:58:10 +0100 Subject: Replace 'foo.length() >= 1' pattern with !foo.empty() --- Source/cmFileCommand.cxx | 2 +- Source/cmake.cxx | 2 +- 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 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(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)) { -- cgit v0.12