[clang-tools-extra] r226817 - Replace size call with empty call where appripriate in clang/tools/extra

Alexander Kornienko alexfh at google.com
Thu Jan 22 05:14:30 PST 2015


Author: alexfh
Date: Thu Jan 22 07:14:29 2015
New Revision: 226817

URL: http://llvm.org/viewvc/llvm-project?rev=226817&view=rev
Log:
Replace size call with empty call where appripriate in clang/tools/extra

This patch is the result of applying fixes of the ContainerSizeEmpty Clang-Tidy
checker which was committed recently.

http://reviews.llvm.org/D7085

Patch by Gábor Horváth!

Modified:
    clang-tools-extra/trunk/modularize/ModuleAssistant.cpp
    clang-tools-extra/trunk/module-map-checker/ModuleMapChecker.cpp

Modified: clang-tools-extra/trunk/modularize/ModuleAssistant.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/modularize/ModuleAssistant.cpp?rev=226817&r1=226816&r2=226817&view=diff
==============================================================================
--- clang-tools-extra/trunk/modularize/ModuleAssistant.cpp (original)
+++ clang-tools-extra/trunk/modularize/ModuleAssistant.cpp Thu Jan 22 07:14:29 2015
@@ -68,7 +68,7 @@ Module::Module() {}
 // Destructor.
 Module::~Module() {
   // Free submodules.
-  while (SubModules.size()) {
+  while (!SubModules.empty()) {
     Module *last = SubModules.back();
     SubModules.pop_back();
     delete last;

Modified: clang-tools-extra/trunk/module-map-checker/ModuleMapChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/module-map-checker/ModuleMapChecker.cpp?rev=226817&r1=226816&r2=226817&view=diff
==============================================================================
--- clang-tools-extra/trunk/module-map-checker/ModuleMapChecker.cpp (original)
+++ clang-tools-extra/trunk/module-map-checker/ModuleMapChecker.cpp Thu Jan 22 07:14:29 2015
@@ -261,7 +261,7 @@ std::error_code ModuleMapChecker::doChec
   findUnaccountedForHeaders();
 
   // Check for warnings.
-  if (UnaccountedForHeaders.size())
+  if (!UnaccountedForHeaders.empty())
     returnValue = std::error_code(1, std::generic_category());
 
   // Dump module map if requested.






More information about the cfe-commits mailing list