Explorar el Código

clang-tidy: fix `readability-container-size-empty` lints

Ben Boeckel hace 2 años
padre
commit
714a466eeb

+ 1 - 1
Source/cmGlobalVisualStudio7Generator.cxx

@@ -457,7 +457,7 @@ void cmGlobalVisualStudio7Generator::WriteTargetsToSolution(
         std::string cumulativePath;
 
         for (std::string const& iter : tokens) {
-          if (!iter.size()) {
+          if (iter.empty()) {
             continue;
           }
 

+ 2 - 2
Source/cmVSSetupHelper.cxx

@@ -496,7 +496,7 @@ bool cmVSSetupAPIHelper::EnumerateAndChooseVSInstance()
     return this->LoadSpecifiedVSInstanceFromDisk();
   }
 
-  if (vecVSInstances.size() > 0) {
+  if (!vecVSInstances.empty()) {
     isVSInstanceExists = true;
     int index = ChooseVSInstance(vecVSInstances);
     chosenInstanceInfo = vecVSInstances[index];
@@ -508,7 +508,7 @@ bool cmVSSetupAPIHelper::EnumerateAndChooseVSInstance()
 int cmVSSetupAPIHelper::ChooseVSInstance(
   const std::vector<VSInstanceInfo>& vecVSInstances)
 {
-  if (vecVSInstances.size() == 0)
+  if (vecVSInstances.empty())
     return -1;
 
   if (vecVSInstances.size() == 1)

+ 1 - 1
Source/cmVisualStudio10TargetGenerator.cxx

@@ -2533,7 +2533,7 @@ void cmVisualStudio10TargetGenerator::WriteAllSources(Elem& e0)
 
       Elem e2(e1, tool);
       bool isCSharp = (si.Source->GetLanguage() == "CSharp");
-      if (isCSharp && exclude_configs.size() > 0) {
+      if (isCSharp && !exclude_configs.empty()) {
         std::stringstream conditions;
         bool firstConditionSet{ false };
         for (const auto& ci : include_configs) {