Explorar el Código

use empty method to check for emptyness

Daniel Pfeifer hace 9 años
padre
commit
73f648f167
Se han modificado 44 ficheros con 46 adiciones y 46 borrados
  1. 1 1
      Source/cmAddCompileOptionsCommand.cxx
  2. 1 1
      Source/cmAddCustomTargetCommand.cxx
  3. 1 1
      Source/cmAddDefinitionsCommand.cxx
  4. 1 1
      Source/cmAddLibraryCommand.cxx
  5. 1 1
      Source/cmAddSubDirectoryCommand.cxx
  6. 1 1
      Source/cmBuildCommand.cxx
  7. 1 1
      Source/cmBuildNameCommand.cxx
  8. 1 1
      Source/cmCMakePolicyCommand.cxx
  9. 1 1
      Source/cmConditionEvaluator.cxx
  10. 1 1
      Source/cmDefinePropertyCommand.cxx
  11. 1 1
      Source/cmEnableLanguageCommand.cxx
  12. 1 1
      Source/cmExecProgramCommand.cxx
  13. 1 1
      Source/cmExecuteProcessCommand.cxx
  14. 1 1
      Source/cmExportBuildAndroidMKGenerator.cxx
  15. 2 2
      Source/cmExportInstallAndroidMKGenerator.cxx
  16. 1 1
      Source/cmExportLibraryDependenciesCommand.cxx
  17. 1 1
      Source/cmFindPackageCommand.cxx
  18. 1 1
      Source/cmForEachCommand.cxx
  19. 1 1
      Source/cmFunctionCommand.cxx
  20. 1 1
      Source/cmIncludeCommand.cxx
  21. 1 1
      Source/cmIncludeDirectoryCommand.cxx
  22. 1 1
      Source/cmIncludeRegularExpressionCommand.cxx
  23. 1 1
      Source/cmLinkDirectoriesCommand.cxx
  24. 1 1
      Source/cmLinkLibrariesCommand.cxx
  25. 2 2
      Source/cmLinkedTree.h
  26. 1 1
      Source/cmLoadCacheCommand.cxx
  27. 1 1
      Source/cmLoadCommandCommand.cxx
  28. 1 1
      Source/cmMacroCommand.cxx
  29. 1 1
      Source/cmMarkAsAdvancedCommand.cxx
  30. 1 1
      Source/cmMathCommand.cxx
  31. 1 1
      Source/cmMessageCommand.cxx
  32. 1 1
      Source/cmProjectCommand.cxx
  33. 1 1
      Source/cmRemoveCommand.cxx
  34. 1 1
      Source/cmRemoveDefinitionsCommand.cxx
  35. 1 1
      Source/cmSetCommand.cxx
  36. 1 1
      Source/cmSetDirectoryPropertiesCommand.cxx
  37. 1 1
      Source/cmSetTestsPropertiesCommand.cxx
  38. 1 1
      Source/cmSourceGroupCommand.cxx
  39. 1 1
      Source/cmStringCommand.cxx
  40. 1 1
      Source/cmSubdirCommand.cxx
  41. 1 1
      Source/cmTargetLinkLibrariesCommand.cxx
  42. 1 1
      Source/cmUnsetCommand.cxx
  43. 1 1
      Source/cmVariableWatchCommand.cxx
  44. 1 1
      Source/cmWhileCommand.cxx

+ 1 - 1
Source/cmAddCompileOptionsCommand.cxx

@@ -14,7 +14,7 @@
 bool cmAddCompileOptionsCommand::InitialPass(
   std::vector<std::string> const& args, cmExecutionStatus&)
 {
-  if (args.size() < 1) {
+  if (args.empty()) {
     return true;
   }
 

+ 1 - 1
Source/cmAddCustomTargetCommand.cxx

@@ -18,7 +18,7 @@
 bool cmAddCustomTargetCommand::InitialPass(
   std::vector<std::string> const& args, cmExecutionStatus&)
 {
-  if (args.size() < 1) {
+  if (args.empty()) {
     this->SetError("called with incorrect number of arguments");
     return false;
   }

+ 1 - 1
Source/cmAddDefinitionsCommand.cxx

@@ -16,7 +16,7 @@ bool cmAddDefinitionsCommand::InitialPass(std::vector<std::string> const& args,
                                           cmExecutionStatus&)
 {
   // it is OK to have no arguments
-  if (args.size() < 1) {
+  if (args.empty()) {
     return true;
   }
 

+ 1 - 1
Source/cmAddLibraryCommand.cxx

@@ -18,7 +18,7 @@
 bool cmAddLibraryCommand::InitialPass(std::vector<std::string> const& args,
                                       cmExecutionStatus&)
 {
-  if (args.size() < 1) {
+  if (args.empty()) {
     this->SetError("called with incorrect number of arguments");
     return false;
   }

+ 1 - 1
Source/cmAddSubDirectoryCommand.cxx

@@ -15,7 +15,7 @@
 bool cmAddSubDirectoryCommand::InitialPass(
   std::vector<std::string> const& args, cmExecutionStatus&)
 {
-  if (args.size() < 1) {
+  if (args.empty()) {
     this->SetError("called with incorrect number of arguments");
     return false;
   }

+ 1 - 1
Source/cmBuildCommand.cxx

@@ -27,7 +27,7 @@ bool cmBuildCommand::InitialPass(std::vector<std::string> const& args,
 
 bool cmBuildCommand::MainSignature(std::vector<std::string> const& args)
 {
-  if (args.size() < 1) {
+  if (args.empty()) {
     this->SetError("requires at least one argument naming a CMake variable");
     return false;
   }

+ 1 - 1
Source/cmBuildNameCommand.cxx

@@ -22,7 +22,7 @@ bool cmBuildNameCommand::InitialPass(std::vector<std::string> 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;
   }

+ 1 - 1
Source/cmCMakePolicyCommand.cxx

@@ -17,7 +17,7 @@
 bool cmCMakePolicyCommand::InitialPass(std::vector<std::string> const& args,
                                        cmExecutionStatus&)
 {
-  if (args.size() < 1) {
+  if (args.empty()) {
     this->SetError("requires at least one argument.");
     return false;
   }

+ 1 - 1
Source/cmConditionEvaluator.cxx

@@ -85,7 +85,7 @@ bool cmConditionEvaluator::IsTrue(
   errorString = "";
 
   // handle empty invocation
-  if (args.size() < 1) {
+  if (args.empty()) {
     return false;
   }
 

+ 1 - 1
Source/cmDefinePropertyCommand.cxx

@@ -17,7 +17,7 @@
 bool cmDefinePropertyCommand::InitialPass(std::vector<std::string> const& args,
                                           cmExecutionStatus&)
 {
-  if (args.size() < 1) {
+  if (args.empty()) {
     this->SetError("called with incorrect number of arguments");
     return false;
   }

+ 1 - 1
Source/cmEnableLanguageCommand.cxx

@@ -17,7 +17,7 @@ bool cmEnableLanguageCommand::InitialPass(std::vector<std::string> const& args,
 {
   bool optional = false;
   std::vector<std::string> languages;
-  if (args.size() < 1) {
+  if (args.empty()) {
     this->SetError("called with incorrect number of arguments");
     return false;
   }

+ 1 - 1
Source/cmExecProgramCommand.cxx

@@ -19,7 +19,7 @@
 bool cmExecProgramCommand::InitialPass(std::vector<std::string> const& args,
                                        cmExecutionStatus&)
 {
-  if (args.size() < 1) {
+  if (args.empty()) {
     this->SetError("called with incorrect number of arguments");
     return false;
   }

+ 1 - 1
Source/cmExecuteProcessCommand.cxx

@@ -31,7 +31,7 @@ void cmExecuteProcessCommandAppend(std::vector<char>& output, const char* data,
 bool cmExecuteProcessCommand::InitialPass(std::vector<std::string> const& args,
                                           cmExecutionStatus&)
 {
-  if (args.size() < 1) {
+  if (args.empty()) {
     this->SetError("called with incorrect number of arguments");
     return false;
   }

+ 1 - 1
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(

+ 2 - 2
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(

+ 1 - 1
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;
   }

+ 1 - 1
Source/cmFindPackageCommand.cxx

@@ -89,7 +89,7 @@ void cmFindPackageCommand::AppendSearchPathGroups()
 bool cmFindPackageCommand::InitialPass(std::vector<std::string> const& args,
                                        cmExecutionStatus&)
 {
-  if (args.size() < 1) {
+  if (args.empty()) {
     this->SetError("called with incorrect number of arguments");
     return false;
   }

+ 1 - 1
Source/cmForEachCommand.cxx

@@ -113,7 +113,7 @@ bool cmForEachFunctionBlocker::ShouldRemove(const cmListFileFunction& lff,
 bool cmForEachCommand::InitialPass(std::vector<std::string> const& args,
                                    cmExecutionStatus&)
 {
-  if (args.size() < 1) {
+  if (args.empty()) {
     this->SetError("called with incorrect number of arguments");
     return false;
   }

+ 1 - 1
Source/cmFunctionCommand.cxx

@@ -202,7 +202,7 @@ bool cmFunctionFunctionBlocker::ShouldRemove(const cmListFileFunction& lff,
 bool cmFunctionCommand::InitialPass(std::vector<std::string> const& args,
                                     cmExecutionStatus&)
 {
-  if (args.size() < 1) {
+  if (args.empty()) {
     this->SetError("called with incorrect number of arguments");
     return false;
   }

+ 1 - 1
Source/cmIncludeCommand.cxx

@@ -15,7 +15,7 @@
 bool cmIncludeCommand::InitialPass(std::vector<std::string> 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;

+ 1 - 1
Source/cmIncludeDirectoryCommand.cxx

@@ -15,7 +15,7 @@
 bool cmIncludeDirectoryCommand::InitialPass(
   std::vector<std::string> const& args, cmExecutionStatus&)
 {
-  if (args.size() < 1) {
+  if (args.empty()) {
     return true;
   }
 

+ 1 - 1
Source/cmIncludeRegularExpressionCommand.cxx

@@ -15,7 +15,7 @@
 bool cmIncludeRegularExpressionCommand::InitialPass(
   std::vector<std::string> 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;
   }

+ 1 - 1
Source/cmLinkDirectoriesCommand.cxx

@@ -15,7 +15,7 @@
 bool cmLinkDirectoriesCommand::InitialPass(
   std::vector<std::string> const& args, cmExecutionStatus&)
 {
-  if (args.size() < 1) {
+  if (args.empty()) {
     return true;
   }
 

+ 1 - 1
Source/cmLinkLibrariesCommand.cxx

@@ -15,7 +15,7 @@
 bool cmLinkLibrariesCommand::InitialPass(std::vector<std::string> const& args,
                                          cmExecutionStatus&)
 {
-  if (args.size() < 1) {
+  if (args.empty()) {
     return true;
   }
   // add libraries, nothe that there is an optional prefix

+ 2 - 2
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);
   }

+ 1 - 1
Source/cmLoadCacheCommand.cxx

@@ -18,7 +18,7 @@
 bool cmLoadCacheCommand::InitialPass(std::vector<std::string> const& args,
                                      cmExecutionStatus&)
 {
-  if (args.size() < 1) {
+  if (args.empty()) {
     this->SetError("called with wrong number of arguments.");
   }
 

+ 1 - 1
Source/cmLoadCommandCommand.cxx

@@ -183,7 +183,7 @@ bool cmLoadCommandCommand::InitialPass(std::vector<std::string> const& args,
         "The load_command command should not be called; see CMP0031.")) {
     return true;
   }
-  if (args.size() < 1) {
+  if (args.empty()) {
     return true;
   }
 

+ 1 - 1
Source/cmMacroCommand.cxx

@@ -236,7 +236,7 @@ bool cmMacroFunctionBlocker::ShouldRemove(const cmListFileFunction& lff,
 bool cmMacroCommand::InitialPass(std::vector<std::string> const& args,
                                  cmExecutionStatus&)
 {
-  if (args.size() < 1) {
+  if (args.empty()) {
     this->SetError("called with incorrect number of arguments");
     return false;
   }

+ 1 - 1
Source/cmMarkAsAdvancedCommand.cxx

@@ -15,7 +15,7 @@
 bool cmMarkAsAdvancedCommand::InitialPass(std::vector<std::string> const& args,
                                           cmExecutionStatus&)
 {
-  if (args.size() < 1) {
+  if (args.empty()) {
     this->SetError("called with incorrect number of arguments");
     return false;
   }

+ 1 - 1
Source/cmMathCommand.cxx

@@ -16,7 +16,7 @@
 bool cmMathCommand::InitialPass(std::vector<std::string> const& args,
                                 cmExecutionStatus&)
 {
-  if (args.size() < 1) {
+  if (args.empty()) {
     this->SetError("must be called with at least one argument.");
     return false;
   }

+ 1 - 1
Source/cmMessageCommand.cxx

@@ -17,7 +17,7 @@
 bool cmMessageCommand::InitialPass(std::vector<std::string> const& args,
                                    cmExecutionStatus&)
 {
-  if (args.size() < 1) {
+  if (args.empty()) {
     this->SetError("called with incorrect number of arguments");
     return false;
   }

+ 1 - 1
Source/cmProjectCommand.cxx

@@ -15,7 +15,7 @@
 bool cmProjectCommand::InitialPass(std::vector<std::string> const& args,
                                    cmExecutionStatus&)
 {
-  if (args.size() < 1) {
+  if (args.empty()) {
     this->SetError("PROJECT called with incorrect number of arguments");
     return false;
   }

+ 1 - 1
Source/cmRemoveCommand.cxx

@@ -15,7 +15,7 @@
 bool cmRemoveCommand::InitialPass(std::vector<std::string> const& args,
                                   cmExecutionStatus&)
 {
-  if (args.size() < 1) {
+  if (args.empty()) {
     return true;
   }
 

+ 1 - 1
Source/cmRemoveDefinitionsCommand.cxx

@@ -16,7 +16,7 @@ bool cmRemoveDefinitionsCommand::InitialPass(
   std::vector<std::string> const& args, cmExecutionStatus&)
 {
   // it is OK to have no arguments
-  if (args.size() < 1) {
+  if (args.empty()) {
     return true;
   }
 

+ 1 - 1
Source/cmSetCommand.cxx

@@ -15,7 +15,7 @@
 bool cmSetCommand::InitialPass(std::vector<std::string> const& args,
                                cmExecutionStatus&)
 {
-  if (args.size() < 1) {
+  if (args.empty()) {
     this->SetError("called with incorrect number of arguments");
     return false;
   }

+ 1 - 1
Source/cmSetDirectoryPropertiesCommand.cxx

@@ -17,7 +17,7 @@
 bool cmSetDirectoryPropertiesCommand::InitialPass(
   std::vector<std::string> const& args, cmExecutionStatus&)
 {
-  if (args.size() < 1) {
+  if (args.empty()) {
     this->SetError("called with incorrect number of arguments");
     return false;
   }

+ 1 - 1
Source/cmSetTestsPropertiesCommand.cxx

@@ -18,7 +18,7 @@
 bool cmSetTestsPropertiesCommand::InitialPass(
   std::vector<std::string> const& args, cmExecutionStatus&)
 {
-  if (args.size() < 1) {
+  if (args.empty()) {
     this->SetError("called with incorrect number of arguments");
     return false;
   }

+ 1 - 1
Source/cmSourceGroupCommand.cxx

@@ -15,7 +15,7 @@
 bool cmSourceGroupCommand::InitialPass(std::vector<std::string> const& args,
                                        cmExecutionStatus&)
 {
-  if (args.size() < 1) {
+  if (args.empty()) {
     this->SetError("called with incorrect number of arguments");
     return false;
   }

+ 1 - 1
Source/cmStringCommand.cxx

@@ -26,7 +26,7 @@
 bool cmStringCommand::InitialPass(std::vector<std::string> const& args,
                                   cmExecutionStatus&)
 {
-  if (args.size() < 1) {
+  if (args.empty()) {
     this->SetError("must be called with at least one argument.");
     return false;
   }

+ 1 - 1
Source/cmSubdirCommand.cxx

@@ -15,7 +15,7 @@
 bool cmSubdirCommand::InitialPass(std::vector<std::string> const& args,
                                   cmExecutionStatus&)
 {
-  if (args.size() < 1) {
+  if (args.empty()) {
     this->SetError("called with incorrect number of arguments");
     return false;
   }

+ 1 - 1
Source/cmTargetLinkLibrariesCommand.cxx

@@ -22,7 +22,7 @@ bool cmTargetLinkLibrariesCommand::InitialPass(
   std::vector<std::string> const& args, cmExecutionStatus&)
 {
   // must have one argument
-  if (args.size() < 1) {
+  if (args.empty()) {
     this->SetError("called with incorrect number of arguments");
     return false;
   }

+ 1 - 1
Source/cmUnsetCommand.cxx

@@ -15,7 +15,7 @@
 bool cmUnsetCommand::InitialPass(std::vector<std::string> 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;
   }

+ 1 - 1
Source/cmVariableWatchCommand.cxx

@@ -104,7 +104,7 @@ cmVariableWatchCommand::~cmVariableWatchCommand()
 bool cmVariableWatchCommand::InitialPass(std::vector<std::string> const& args,
                                          cmExecutionStatus&)
 {
-  if (args.size() < 1) {
+  if (args.empty()) {
     this->SetError("must be called with at least one argument.");
     return false;
   }

+ 1 - 1
Source/cmWhileCommand.cxx

@@ -133,7 +133,7 @@ bool cmWhileFunctionBlocker::ShouldRemove(const cmListFileFunction& lff,
 bool cmWhileCommand::InvokeInitialPass(
   const std::vector<cmListFileArgument>& args, cmExecutionStatus&)
 {
-  if (args.size() < 1) {
+  if (args.empty()) {
     this->SetError("called with incorrect number of arguments");
     return false;
   }