diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-01-15 22:39:38 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-01-18 13:25:25 (GMT) |
commit | 5f69314ea65ebd0de23484e7c91bd12a8bf861f6 (patch) | |
tree | d50bbf578696dfa13e36dbf684de70a2a0c913d8 | |
parent | fd0c036c0c3e5e6be685e64caecdcbad4b3e744c (diff) | |
download | CMake-5f69314ea65ebd0de23484e7c91bd12a8bf861f6.zip CMake-5f69314ea65ebd0de23484e7c91bd12a8bf861f6.tar.gz CMake-5f69314ea65ebd0de23484e7c91bd12a8bf861f6.tar.bz2 |
Replace foo.length() pattern with !foo.empty().
-rw-r--r-- | Source/cmBuildNameCommand.cxx | 2 | ||||
-rw-r--r-- | Source/cmDocumentationFormatter.cxx | 4 | ||||
-rw-r--r-- | Source/cmLoadCacheCommand.cxx | 4 | ||||
-rw-r--r-- | Source/cmLocalGenerator.cxx | 2 | ||||
-rw-r--r-- | Source/cmSiteNameCommand.cxx | 4 |
5 files changed, 8 insertions, 8 deletions
diff --git a/Source/cmBuildNameCommand.cxx b/Source/cmBuildNameCommand.cxx index c64209f..171ed0f 100644 --- a/Source/cmBuildNameCommand.cxx +++ b/Source/cmBuildNameCommand.cxx @@ -50,7 +50,7 @@ bool cmBuildNameCommand { buildname = ""; cmSystemTools::RunSingleCommand("uname -a", &buildname); - if(buildname.length()) + if(!buildname.empty()) { std::string RegExp = "([^ ]*) [^ ]* ([^ ]*) "; cmsys::RegularExpression reg( RegExp.c_str() ); diff --git a/Source/cmDocumentationFormatter.cxx b/Source/cmDocumentationFormatter.cxx index adf29b1..4de59c0 100644 --- a/Source/cmDocumentationFormatter.cxx +++ b/Source/cmDocumentationFormatter.cxx @@ -46,7 +46,7 @@ void cmDocumentationFormatter::PrintFormatted(std::ostream& os, preformatted.append(1, '\n'); } } - if(preformatted.length()) + if(!preformatted.empty()) { this->PrintPreformatted(os, preformatted.c_str()); } @@ -62,7 +62,7 @@ void cmDocumentationFormatter::PrintFormatted(std::ostream& os, ++ptr; paragraph.append(1, '\n'); } - if(paragraph.length()) + if(!paragraph.empty()) { this->PrintParagraph(os, paragraph.c_str()); } diff --git a/Source/cmLoadCacheCommand.cxx b/Source/cmLoadCacheCommand.cxx index 427e29d..540dd3b 100644 --- a/Source/cmLoadCacheCommand.cxx +++ b/Source/cmLoadCacheCommand.cxx @@ -160,7 +160,7 @@ bool cmLoadCacheCommand::ReadWithPrefix(std::vector<std::string> const& args) } } } - if(line.length()) + if(!line.empty()) { // Partial last line. this->CheckLine(line.c_str()); @@ -184,7 +184,7 @@ void cmLoadCacheCommand::CheckLine(const char* line) // This was requested. Set this variable locally with the given // prefix. var = this->Prefix + var; - if(value.length()) + if(!value.empty()) { this->Makefile->AddDefinition(var, value.c_str()); } diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 0cbbdab..834f705 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -335,7 +335,7 @@ void cmLocalGenerator::GenerateTestFiles() { (*gi)->Generate(fout, config, configurationTypes); } - if ( this->Children.size()) + if (!this->Children.empty()) { size_t i; for(i = 0; i < this->Children.size(); ++i) diff --git a/Source/cmSiteNameCommand.cxx b/Source/cmSiteNameCommand.cxx index e61caab..927888b 100644 --- a/Source/cmSiteNameCommand.cxx +++ b/Source/cmSiteNameCommand.cxx @@ -66,7 +66,7 @@ bool cmSiteNameCommand &host, 0, 0, cmSystemTools::OUTPUT_NONE); // got the hostname - if (host.length()) + if (!host.empty()) { // remove any white space from the host name std::string hostRegExp = "[ \t\n\r]*([^\t\n\r ]*)[ \t\n\r]*"; @@ -77,7 +77,7 @@ bool cmSiteNameCommand host = hostReg.match(1); } - if(host.length()) + if(!host.empty()) { siteName = host; } |