Browse Source

Replace 'foo.size() == 0' pattern with foo.empty().

Stephen Kelly 10 years ago
parent
commit
524610f967

+ 2 - 2
Source/CPack/cmCPackNSISGenerator.cxx

@@ -49,7 +49,7 @@ int cmCPackNSISGenerator::PackageFiles()
   // TODO: Fix nsis to force out file name
 
   std::string nsisInFileName = this->FindTemplate("NSIS.template.in");
-  if ( nsisInFileName.size() == 0 )
+  if (nsisInFileName.empty())
     {
     cmCPackLogger(cmCPackLog::LOG_ERROR,
       "CPack error: Could not find NSIS installer template file."
@@ -58,7 +58,7 @@ int cmCPackNSISGenerator::PackageFiles()
     }
   std::string nsisInInstallOptions
     = this->FindTemplate("NSIS.InstallOptions.ini.in");
-  if ( nsisInInstallOptions.size() == 0 )
+  if (nsisInInstallOptions.empty())
     {
     cmCPackLogger(cmCPackLog::LOG_ERROR,
       "CPack error: Could not find NSIS installer options file."

+ 1 - 1
Source/cmGlobalVisualStudio6Generator.cxx

@@ -255,7 +255,7 @@ void cmGlobalVisualStudio6Generator
 ::OutputDSWFile(cmLocalGenerator* root,
                 std::vector<cmLocalGenerator*>& generators)
 {
-  if(generators.size() == 0)
+  if(generators.empty())
     {
     return;
     }

+ 1 - 1
Source/cmGlobalVisualStudio71Generator.cxx

@@ -212,7 +212,7 @@ cmGlobalVisualStudio71Generator
     {
     const char* name = di->c_str();
     std::string guid = this->GetGUID(name);
-    if(guid.size() == 0)
+    if(guid.empty())
       {
       std::string m = "Target: ";
       m += target.GetName();

+ 2 - 2
Source/cmGlobalVisualStudio7Generator.cxx

@@ -359,7 +359,7 @@ void cmGlobalVisualStudio7Generator
 ::OutputSLNFile(cmLocalGenerator* root,
                 std::vector<cmLocalGenerator*>& generators)
 {
-  if(generators.size() == 0)
+  if(generators.empty())
     {
     return;
     }
@@ -736,7 +736,7 @@ cmGlobalVisualStudio7Generator
     {
     const char* name = di->c_str();
     std::string guid = this->GetGUID(name);
-    if(guid.size() == 0)
+    if(guid.empty())
       {
       std::string m = "Target: ";
       m += target.GetName();

+ 3 - 3
Source/cmLocalVisualStudio6Generator.cxx

@@ -988,7 +988,7 @@ void cmLocalVisualStudio6Generator
     {
     std::string lpath =
       this->ConvertToOutputFormat(libPath.c_str(), SHELL);
-    if(lpath.size() == 0)
+    if(lpath.empty())
       {
       lpath = ".";
       }
@@ -1021,7 +1021,7 @@ void cmLocalVisualStudio6Generator
     {
     std::string lpath =
       this->ConvertToOutputFormat(exePath.c_str(), SHELL);
-    if(lpath.size() == 0)
+    if(lpath.empty())
       {
       lpath = ".";
       }
@@ -1062,7 +1062,7 @@ void cmLocalVisualStudio6Generator
       }
     std::string lpath =
       this->ConvertToOutputFormat(path.c_str(), SHELL);
-    if(lpath.size() == 0)
+    if(lpath.empty())
       {
       lpath = ".";
       }

+ 1 - 1
Source/cmLocalVisualStudio7Generator.cxx

@@ -2331,7 +2331,7 @@ void cmLocalVisualStudio7Generator::ReadAndStoreExternalGUID(
   cmVS7XMLParser parser;
   parser.ParseFile(path);
   // if we can not find a GUID then we will generate one later
-  if(parser.GUID.size() == 0)
+  if(parser.GUID.empty())
     {
     return;
     }

+ 1 - 1
Source/cmVisualStudio10TargetGenerator.cxx

@@ -2783,7 +2783,7 @@ void cmVisualStudio10TargetGenerator::WriteEvent(
   std::vector<cmCustomCommand> const& commands,
   std::string const& configName)
 {
-  if(commands.size() == 0)
+  if(commands.empty())
     {
     return;
     }

+ 1 - 1
Source/cmXCode21Object.cxx

@@ -22,7 +22,7 @@ cmXCode21Object::cmXCode21Object(PBXType ptype, Type type)
 //----------------------------------------------------------------------------
 void cmXCode21Object::PrintComment(std::ostream& out)
 {
-  if(this->Comment.size() == 0)
+  if(this->Comment.empty())
     {
     cmXCodeObject* n = this->GetObject("name");
     if(n)