[lld] r299501 - Use empty() instead of size().

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 4 20:19:25 PDT 2017


Author: ruiu
Date: Tue Apr  4 22:19:24 2017
New Revision: 299501

URL: http://llvm.org/viewvc/llvm-project?rev=299501&view=rev
Log:
Use empty() instead of size().

`!V.size()` where V is a vector is equivalent to `V.empty()`.

Modified:
    lld/trunk/ELF/LinkerScript.cpp

Modified: lld/trunk/ELF/LinkerScript.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LinkerScript.cpp?rev=299501&r1=299500&r2=299501&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.cpp (original)
+++ lld/trunk/ELF/LinkerScript.cpp Tue Apr  4 22:19:24 2017
@@ -621,7 +621,7 @@ MemoryRegion *LinkerScript::findMemoryRe
   // searched for in the region map. If the region map is empty, just
   // return. Note that this check doesn't happen at the very beginning
   // so that uses of undeclared regions can be caught.
-  if (!Opt.MemoryRegions.size())
+  if (Opt.MemoryRegions.empty())
     return nullptr;
 
   // See if a region can be found by matching section flags.




More information about the llvm-commits mailing list