Simplify. NFC.
authorRui Ueyama <ruiu@google.com>
Thu, 17 Nov 2016 02:16:06 +0000 (02:16 +0000)
committerRui Ueyama <ruiu@google.com>
Thu, 17 Nov 2016 02:16:06 +0000 (02:16 +0000)
llvm-svn: 287192

lld/ELF/SymbolTable.cpp

index 6465013..949e7fc 100644 (file)
@@ -643,12 +643,9 @@ template <class ELFT> void SymbolTable<ELFT>::handleAnonymousVersion() {
     if (SymbolBody *B = find(Ver.Name))
       B->symbol()->VersionId = VER_NDX_GLOBAL;
   }
-  if (Patterns.empty())
-    return;
-  StringMatcher M(Patterns);
-  std::vector<SymbolBody *> Syms = findAll(M);
-  for (SymbolBody *B : Syms)
-    B->symbol()->VersionId = VER_NDX_GLOBAL;
+  if (!Patterns.empty())
+    for (SymbolBody *B : findAll(StringMatcher(Patterns)))
+      B->symbol()->VersionId = VER_NDX_GLOBAL;
 }
 
 // Set symbol versions to symbols. This function handles patterns