From 73f648f167e9b11739c4dbbdbd5c024baf1e39ad Mon Sep 17 00:00:00 2001 From: Daniel Pfeifer Date: Thu, 15 Sep 2016 23:59:29 +0200 Subject: use empty method to check for emptyness --- Source/cmAddCompileOptionsCommand.cxx | 2 +- Source/cmAddCustomTargetCommand.cxx | 2 +- Source/cmAddDefinitionsCommand.cxx | 2 +- Source/cmAddLibraryCommand.cxx | 2 +- Source/cmAddSubDirectoryCommand.cxx | 2 +- Source/cmBuildCommand.cxx | 2 +- Source/cmBuildNameCommand.cxx | 2 +- Source/cmCMakePolicyCommand.cxx | 2 +- Source/cmConditionEvaluator.cxx | 2 +- Source/cmDefinePropertyCommand.cxx | 2 +- Source/cmEnableLanguageCommand.cxx | 2 +- Source/cmExecProgramCommand.cxx | 2 +- Source/cmExecuteProcessCommand.cxx | 2 +- Source/cmExportBuildAndroidMKGenerator.cxx | 2 +- Source/cmExportInstallAndroidMKGenerator.cxx | 4 ++-- Source/cmExportLibraryDependenciesCommand.cxx | 2 +- Source/cmFindPackageCommand.cxx | 2 +- Source/cmForEachCommand.cxx | 2 +- Source/cmFunctionCommand.cxx | 2 +- Source/cmIncludeCommand.cxx | 2 +- Source/cmIncludeDirectoryCommand.cxx | 2 +- Source/cmIncludeRegularExpressionCommand.cxx | 2 +- Source/cmLinkDirectoriesCommand.cxx | 2 +- Source/cmLinkLibrariesCommand.cxx | 2 +- Source/cmLinkedTree.h | 4 ++-- Source/cmLoadCacheCommand.cxx | 2 +- Source/cmLoadCommandCommand.cxx | 2 +- Source/cmMacroCommand.cxx | 2 +- Source/cmMarkAsAdvancedCommand.cxx | 2 +- Source/cmMathCommand.cxx | 2 +- Source/cmMessageCommand.cxx | 2 +- Source/cmProjectCommand.cxx | 2 +- Source/cmRemoveCommand.cxx | 2 +- Source/cmRemoveDefinitionsCommand.cxx | 2 +- Source/cmSetCommand.cxx | 2 +- Source/cmSetDirectoryPropertiesCommand.cxx | 2 +- Source/cmSetTestsPropertiesCommand.cxx | 2 +- Source/cmSourceGroupCommand.cxx | 2 +- Source/cmStringCommand.cxx | 2 +- Source/cmSubdirCommand.cxx | 2 +- Source/cmTargetLinkLibrariesCommand.cxx | 2 +- Source/cmUnsetCommand.cxx | 2 +- Source/cmVariableWatchCommand.cxx | 2 +- Source/cmWhileCommand.cxx | 2 +- 44 files changed, 46 insertions(+), 46 deletions(-) diff --git a/Source/cmAddCompileOptionsCommand.cxx b/Source/cmAddCompileOptionsCommand.cxx index 2223cf47bc..cbba831feb 100644 --- a/Source/cmAddCompileOptionsCommand.cxx +++ b/Source/cmAddCompileOptionsCommand.cxx @@ -14,7 +14,7 @@ bool cmAddCompileOptionsCommand::InitialPass( std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { return true; } diff --git a/Source/cmAddCustomTargetCommand.cxx b/Source/cmAddCustomTargetCommand.cxx index 9dc7c590ff..8e149669b3 100644 --- a/Source/cmAddCustomTargetCommand.cxx +++ b/Source/cmAddCustomTargetCommand.cxx @@ -18,7 +18,7 @@ bool cmAddCustomTargetCommand::InitialPass( std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { this->SetError("called with incorrect number of arguments"); return false; } diff --git a/Source/cmAddDefinitionsCommand.cxx b/Source/cmAddDefinitionsCommand.cxx index 2d0d026176..5f2b32f82b 100644 --- a/Source/cmAddDefinitionsCommand.cxx +++ b/Source/cmAddDefinitionsCommand.cxx @@ -16,7 +16,7 @@ bool cmAddDefinitionsCommand::InitialPass(std::vector const& args, cmExecutionStatus&) { // it is OK to have no arguments - if (args.size() < 1) { + if (args.empty()) { return true; } diff --git a/Source/cmAddLibraryCommand.cxx b/Source/cmAddLibraryCommand.cxx index 4516ed24a4..5a4005094a 100644 --- a/Source/cmAddLibraryCommand.cxx +++ b/Source/cmAddLibraryCommand.cxx @@ -18,7 +18,7 @@ bool cmAddLibraryCommand::InitialPass(std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { this->SetError("called with incorrect number of arguments"); return false; } diff --git a/Source/cmAddSubDirectoryCommand.cxx b/Source/cmAddSubDirectoryCommand.cxx index 63a9051899..1a781ccdb9 100644 --- a/Source/cmAddSubDirectoryCommand.cxx +++ b/Source/cmAddSubDirectoryCommand.cxx @@ -15,7 +15,7 @@ bool cmAddSubDirectoryCommand::InitialPass( std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { this->SetError("called with incorrect number of arguments"); return false; } diff --git a/Source/cmBuildCommand.cxx b/Source/cmBuildCommand.cxx index 98308670f5..6146053dca 100644 --- a/Source/cmBuildCommand.cxx +++ b/Source/cmBuildCommand.cxx @@ -27,7 +27,7 @@ bool cmBuildCommand::InitialPass(std::vector const& args, bool cmBuildCommand::MainSignature(std::vector const& args) { - if (args.size() < 1) { + if (args.empty()) { this->SetError("requires at least one argument naming a CMake variable"); return false; } diff --git a/Source/cmBuildNameCommand.cxx b/Source/cmBuildNameCommand.cxx index 27234d73cf..3d0203439f 100644 --- a/Source/cmBuildNameCommand.cxx +++ b/Source/cmBuildNameCommand.cxx @@ -22,7 +22,7 @@ bool cmBuildNameCommand::InitialPass(std::vector const& args, "The build_name command should not be called; see CMP0036.")) { return true; } - if (args.size() < 1) { + if (args.empty()) { this->SetError("called with incorrect number of arguments"); return false; } diff --git a/Source/cmCMakePolicyCommand.cxx b/Source/cmCMakePolicyCommand.cxx index 07e0885abd..03c4a37109 100644 --- a/Source/cmCMakePolicyCommand.cxx +++ b/Source/cmCMakePolicyCommand.cxx @@ -17,7 +17,7 @@ bool cmCMakePolicyCommand::InitialPass(std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { this->SetError("requires at least one argument."); return false; } diff --git a/Source/cmConditionEvaluator.cxx b/Source/cmConditionEvaluator.cxx index 94f03e8511..e670dc6fdd 100644 --- a/Source/cmConditionEvaluator.cxx +++ b/Source/cmConditionEvaluator.cxx @@ -85,7 +85,7 @@ bool cmConditionEvaluator::IsTrue( errorString = ""; // handle empty invocation - if (args.size() < 1) { + if (args.empty()) { return false; } diff --git a/Source/cmDefinePropertyCommand.cxx b/Source/cmDefinePropertyCommand.cxx index 484a970175..358952907a 100644 --- a/Source/cmDefinePropertyCommand.cxx +++ b/Source/cmDefinePropertyCommand.cxx @@ -17,7 +17,7 @@ bool cmDefinePropertyCommand::InitialPass(std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { this->SetError("called with incorrect number of arguments"); return false; } diff --git a/Source/cmEnableLanguageCommand.cxx b/Source/cmEnableLanguageCommand.cxx index 0ebe778467..9b7dd0394b 100644 --- a/Source/cmEnableLanguageCommand.cxx +++ b/Source/cmEnableLanguageCommand.cxx @@ -17,7 +17,7 @@ bool cmEnableLanguageCommand::InitialPass(std::vector const& args, { bool optional = false; std::vector languages; - if (args.size() < 1) { + if (args.empty()) { this->SetError("called with incorrect number of arguments"); return false; } diff --git a/Source/cmExecProgramCommand.cxx b/Source/cmExecProgramCommand.cxx index 58bbc31563..284f48621d 100644 --- a/Source/cmExecProgramCommand.cxx +++ b/Source/cmExecProgramCommand.cxx @@ -19,7 +19,7 @@ bool cmExecProgramCommand::InitialPass(std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { this->SetError("called with incorrect number of arguments"); return false; } diff --git a/Source/cmExecuteProcessCommand.cxx b/Source/cmExecuteProcessCommand.cxx index d97b25f8ee..81d8a1fa9b 100644 --- a/Source/cmExecuteProcessCommand.cxx +++ b/Source/cmExecuteProcessCommand.cxx @@ -31,7 +31,7 @@ void cmExecuteProcessCommandAppend(std::vector& output, const char* data, bool cmExecuteProcessCommand::InitialPass(std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { this->SetError("called with incorrect number of arguments"); return false; } diff --git a/Source/cmExportBuildAndroidMKGenerator.cxx b/Source/cmExportBuildAndroidMKGenerator.cxx index 3247cc8535..96080a9a78 100644 --- a/Source/cmExportBuildAndroidMKGenerator.cxx +++ b/Source/cmExportBuildAndroidMKGenerator.cxx @@ -69,7 +69,7 @@ void cmExportBuildAndroidMKGenerator::GenerateInterfaceProperties( const ImportPropertyMap& properties) { std::string config = ""; - if (this->Configurations.size()) { + if (!this->Configurations.empty()) { config = this->Configurations[0]; } cmExportBuildAndroidMKGenerator::GenerateInterfaceProperties( diff --git a/Source/cmExportInstallAndroidMKGenerator.cxx b/Source/cmExportInstallAndroidMKGenerator.cxx index 8f815b7085..10ba6eeb41 100644 --- a/Source/cmExportInstallAndroidMKGenerator.cxx +++ b/Source/cmExportInstallAndroidMKGenerator.cxx @@ -76,7 +76,7 @@ void cmExportInstallAndroidMKGenerator::GenerateImportTargetCode( os << "LOCAL_SRC_FILES := $(_IMPORT_PREFIX)/"; os << target->Target->GetProperty("__dest") << "/"; std::string config = ""; - if (this->Configurations.size()) { + if (!this->Configurations.empty()) { config = this->Configurations[0]; } os << target->GetFullName(config) << "\n"; @@ -103,7 +103,7 @@ void cmExportInstallAndroidMKGenerator::GenerateInterfaceProperties( const ImportPropertyMap& properties) { std::string config = ""; - if (this->Configurations.size()) { + if (!this->Configurations.empty()) { config = this->Configurations[0]; } cmExportBuildAndroidMKGenerator::GenerateInterfaceProperties( diff --git a/Source/cmExportLibraryDependenciesCommand.cxx b/Source/cmExportLibraryDependenciesCommand.cxx index b422a2c856..d9c30e77aa 100644 --- a/Source/cmExportLibraryDependenciesCommand.cxx +++ b/Source/cmExportLibraryDependenciesCommand.cxx @@ -27,7 +27,7 @@ bool cmExportLibraryDependenciesCommand::InitialPass( "see CMP0033.")) { return true; } - if (args.size() < 1) { + if (args.empty()) { this->SetError("called with incorrect number of arguments"); return false; } diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 8338c2a767..7761759ff7 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -89,7 +89,7 @@ void cmFindPackageCommand::AppendSearchPathGroups() bool cmFindPackageCommand::InitialPass(std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { this->SetError("called with incorrect number of arguments"); return false; } diff --git a/Source/cmForEachCommand.cxx b/Source/cmForEachCommand.cxx index c6e5f06659..dadd080349 100644 --- a/Source/cmForEachCommand.cxx +++ b/Source/cmForEachCommand.cxx @@ -113,7 +113,7 @@ bool cmForEachFunctionBlocker::ShouldRemove(const cmListFileFunction& lff, bool cmForEachCommand::InitialPass(std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { this->SetError("called with incorrect number of arguments"); return false; } diff --git a/Source/cmFunctionCommand.cxx b/Source/cmFunctionCommand.cxx index 40c54dbdc2..bda96aa21c 100644 --- a/Source/cmFunctionCommand.cxx +++ b/Source/cmFunctionCommand.cxx @@ -202,7 +202,7 @@ bool cmFunctionFunctionBlocker::ShouldRemove(const cmListFileFunction& lff, bool cmFunctionCommand::InitialPass(std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { this->SetError("called with incorrect number of arguments"); return false; } diff --git a/Source/cmIncludeCommand.cxx b/Source/cmIncludeCommand.cxx index 360ebeb4b2..c90314e1e8 100644 --- a/Source/cmIncludeCommand.cxx +++ b/Source/cmIncludeCommand.cxx @@ -15,7 +15,7 @@ bool cmIncludeCommand::InitialPass(std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1 || args.size() > 4) { + if (args.empty() || args.size() > 4) { this->SetError("called with wrong number of arguments. " "include() only takes one file."); return false; diff --git a/Source/cmIncludeDirectoryCommand.cxx b/Source/cmIncludeDirectoryCommand.cxx index cafdba7889..904fcca21f 100644 --- a/Source/cmIncludeDirectoryCommand.cxx +++ b/Source/cmIncludeDirectoryCommand.cxx @@ -15,7 +15,7 @@ bool cmIncludeDirectoryCommand::InitialPass( std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { return true; } diff --git a/Source/cmIncludeRegularExpressionCommand.cxx b/Source/cmIncludeRegularExpressionCommand.cxx index 2473dff569..bd26d93f02 100644 --- a/Source/cmIncludeRegularExpressionCommand.cxx +++ b/Source/cmIncludeRegularExpressionCommand.cxx @@ -15,7 +15,7 @@ bool cmIncludeRegularExpressionCommand::InitialPass( std::vector const& args, cmExecutionStatus&) { - if ((args.size() < 1) || (args.size() > 2)) { + if ((args.empty()) || (args.size() > 2)) { this->SetError("called with incorrect number of arguments"); return false; } diff --git a/Source/cmLinkDirectoriesCommand.cxx b/Source/cmLinkDirectoriesCommand.cxx index a33b429d7a..9b5d54a853 100644 --- a/Source/cmLinkDirectoriesCommand.cxx +++ b/Source/cmLinkDirectoriesCommand.cxx @@ -15,7 +15,7 @@ bool cmLinkDirectoriesCommand::InitialPass( std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { return true; } diff --git a/Source/cmLinkLibrariesCommand.cxx b/Source/cmLinkLibrariesCommand.cxx index 5d23d6a591..bef234e9e8 100644 --- a/Source/cmLinkLibrariesCommand.cxx +++ b/Source/cmLinkLibrariesCommand.cxx @@ -15,7 +15,7 @@ bool cmLinkLibrariesCommand::InitialPass(std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { return true; } // add libraries, nothe that there is an optional prefix diff --git a/Source/cmLinkedTree.h b/Source/cmLinkedTree.h index 466aaa7d7e..025c0a34de 100644 --- a/Source/cmLinkedTree.h +++ b/Source/cmLinkedTree.h @@ -167,10 +167,10 @@ public: iterator Truncate() { - assert(this->UpPositions.size() > 0); + assert(!this->UpPositions.empty()); this->UpPositions.erase(this->UpPositions.begin() + 1, this->UpPositions.end()); - assert(this->Data.size() > 0); + assert(!this->Data.empty()); this->Data.erase(this->Data.begin() + 1, this->Data.end()); return iterator(this, 1); } diff --git a/Source/cmLoadCacheCommand.cxx b/Source/cmLoadCacheCommand.cxx index 85188d19de..6d9cf8ee05 100644 --- a/Source/cmLoadCacheCommand.cxx +++ b/Source/cmLoadCacheCommand.cxx @@ -18,7 +18,7 @@ bool cmLoadCacheCommand::InitialPass(std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { this->SetError("called with wrong number of arguments."); } diff --git a/Source/cmLoadCommandCommand.cxx b/Source/cmLoadCommandCommand.cxx index ddf6ce6c9b..4d8a4e3f4a 100644 --- a/Source/cmLoadCommandCommand.cxx +++ b/Source/cmLoadCommandCommand.cxx @@ -183,7 +183,7 @@ bool cmLoadCommandCommand::InitialPass(std::vector const& args, "The load_command command should not be called; see CMP0031.")) { return true; } - if (args.size() < 1) { + if (args.empty()) { return true; } diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx index ee9dc8af75..5231062750 100644 --- a/Source/cmMacroCommand.cxx +++ b/Source/cmMacroCommand.cxx @@ -236,7 +236,7 @@ bool cmMacroFunctionBlocker::ShouldRemove(const cmListFileFunction& lff, bool cmMacroCommand::InitialPass(std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { this->SetError("called with incorrect number of arguments"); return false; } diff --git a/Source/cmMarkAsAdvancedCommand.cxx b/Source/cmMarkAsAdvancedCommand.cxx index 2fb6a75d87..6c979f607e 100644 --- a/Source/cmMarkAsAdvancedCommand.cxx +++ b/Source/cmMarkAsAdvancedCommand.cxx @@ -15,7 +15,7 @@ bool cmMarkAsAdvancedCommand::InitialPass(std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { this->SetError("called with incorrect number of arguments"); return false; } diff --git a/Source/cmMathCommand.cxx b/Source/cmMathCommand.cxx index ca8b926f98..b812349bf3 100644 --- a/Source/cmMathCommand.cxx +++ b/Source/cmMathCommand.cxx @@ -16,7 +16,7 @@ bool cmMathCommand::InitialPass(std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { this->SetError("must be called with at least one argument."); return false; } diff --git a/Source/cmMessageCommand.cxx b/Source/cmMessageCommand.cxx index c48910e032..e884531667 100644 --- a/Source/cmMessageCommand.cxx +++ b/Source/cmMessageCommand.cxx @@ -17,7 +17,7 @@ bool cmMessageCommand::InitialPass(std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { this->SetError("called with incorrect number of arguments"); return false; } diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx index 139303b024..6f98d9473b 100644 --- a/Source/cmProjectCommand.cxx +++ b/Source/cmProjectCommand.cxx @@ -15,7 +15,7 @@ bool cmProjectCommand::InitialPass(std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { this->SetError("PROJECT called with incorrect number of arguments"); return false; } diff --git a/Source/cmRemoveCommand.cxx b/Source/cmRemoveCommand.cxx index 955f712805..c695374c62 100644 --- a/Source/cmRemoveCommand.cxx +++ b/Source/cmRemoveCommand.cxx @@ -15,7 +15,7 @@ bool cmRemoveCommand::InitialPass(std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { return true; } diff --git a/Source/cmRemoveDefinitionsCommand.cxx b/Source/cmRemoveDefinitionsCommand.cxx index 638eda620c..77de846cd0 100644 --- a/Source/cmRemoveDefinitionsCommand.cxx +++ b/Source/cmRemoveDefinitionsCommand.cxx @@ -16,7 +16,7 @@ bool cmRemoveDefinitionsCommand::InitialPass( std::vector const& args, cmExecutionStatus&) { // it is OK to have no arguments - if (args.size() < 1) { + if (args.empty()) { return true; } diff --git a/Source/cmSetCommand.cxx b/Source/cmSetCommand.cxx index 8fb6aa0575..6bdb28b23d 100644 --- a/Source/cmSetCommand.cxx +++ b/Source/cmSetCommand.cxx @@ -15,7 +15,7 @@ bool cmSetCommand::InitialPass(std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { this->SetError("called with incorrect number of arguments"); return false; } diff --git a/Source/cmSetDirectoryPropertiesCommand.cxx b/Source/cmSetDirectoryPropertiesCommand.cxx index ca758dabc9..858411867f 100644 --- a/Source/cmSetDirectoryPropertiesCommand.cxx +++ b/Source/cmSetDirectoryPropertiesCommand.cxx @@ -17,7 +17,7 @@ bool cmSetDirectoryPropertiesCommand::InitialPass( std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { this->SetError("called with incorrect number of arguments"); return false; } diff --git a/Source/cmSetTestsPropertiesCommand.cxx b/Source/cmSetTestsPropertiesCommand.cxx index 2fb137f263..59d569d78e 100644 --- a/Source/cmSetTestsPropertiesCommand.cxx +++ b/Source/cmSetTestsPropertiesCommand.cxx @@ -18,7 +18,7 @@ bool cmSetTestsPropertiesCommand::InitialPass( std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { this->SetError("called with incorrect number of arguments"); return false; } diff --git a/Source/cmSourceGroupCommand.cxx b/Source/cmSourceGroupCommand.cxx index 6db14c0a4f..6f7ef6c1b8 100644 --- a/Source/cmSourceGroupCommand.cxx +++ b/Source/cmSourceGroupCommand.cxx @@ -15,7 +15,7 @@ bool cmSourceGroupCommand::InitialPass(std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { this->SetError("called with incorrect number of arguments"); return false; } diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx index 3c913eec68..addfed435b 100644 --- a/Source/cmStringCommand.cxx +++ b/Source/cmStringCommand.cxx @@ -26,7 +26,7 @@ bool cmStringCommand::InitialPass(std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { this->SetError("must be called with at least one argument."); return false; } diff --git a/Source/cmSubdirCommand.cxx b/Source/cmSubdirCommand.cxx index 401f588c44..48939784bd 100644 --- a/Source/cmSubdirCommand.cxx +++ b/Source/cmSubdirCommand.cxx @@ -15,7 +15,7 @@ bool cmSubdirCommand::InitialPass(std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { this->SetError("called with incorrect number of arguments"); return false; } diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx index 1c4a9ceca3..b62e225d7a 100644 --- a/Source/cmTargetLinkLibrariesCommand.cxx +++ b/Source/cmTargetLinkLibrariesCommand.cxx @@ -22,7 +22,7 @@ bool cmTargetLinkLibrariesCommand::InitialPass( std::vector const& args, cmExecutionStatus&) { // must have one argument - if (args.size() < 1) { + if (args.empty()) { this->SetError("called with incorrect number of arguments"); return false; } diff --git a/Source/cmUnsetCommand.cxx b/Source/cmUnsetCommand.cxx index 05ba65a16f..5bf137c584 100644 --- a/Source/cmUnsetCommand.cxx +++ b/Source/cmUnsetCommand.cxx @@ -15,7 +15,7 @@ bool cmUnsetCommand::InitialPass(std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1 || args.size() > 2) { + if (args.empty() || args.size() > 2) { this->SetError("called with incorrect number of arguments"); return false; } diff --git a/Source/cmVariableWatchCommand.cxx b/Source/cmVariableWatchCommand.cxx index f30ffe8f4a..cf740db3a2 100644 --- a/Source/cmVariableWatchCommand.cxx +++ b/Source/cmVariableWatchCommand.cxx @@ -104,7 +104,7 @@ cmVariableWatchCommand::~cmVariableWatchCommand() bool cmVariableWatchCommand::InitialPass(std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { this->SetError("must be called with at least one argument."); return false; } diff --git a/Source/cmWhileCommand.cxx b/Source/cmWhileCommand.cxx index 93a62717e8..ad558fea0e 100644 --- a/Source/cmWhileCommand.cxx +++ b/Source/cmWhileCommand.cxx @@ -133,7 +133,7 @@ bool cmWhileFunctionBlocker::ShouldRemove(const cmListFileFunction& lff, bool cmWhileCommand::InvokeInitialPass( const std::vector& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { this->SetError("called with incorrect number of arguments"); return false; } -- cgit v1.2.1