[ELF] - Use early return. NFC.
authorGeorge Rimar <grimar@accesssoftek.com>
Tue, 30 Aug 2016 09:39:36 +0000 (09:39 +0000)
committerGeorge Rimar <grimar@accesssoftek.com>
Tue, 30 Aug 2016 09:39:36 +0000 (09:39 +0000)
This addresses forgotten review comment for r280067:
"[ELF] - Versionscript: support wildcards for extern "c++" tag."

llvm-svn: 280068

lld/ELF/SymbolTable.cpp

index 410a8f3..0f9a14d 100644 (file)
@@ -676,16 +676,17 @@ template <class ELFT> void SymbolTable<ELFT>::scanVersionScript() {
   // Handle wildcards.
   for (size_t I = Config->VersionDefinitions.size() - 1; I != (size_t)-1; --I) {
     VersionDefinition &V = Config->VersionDefinitions[I];
-    for (SymbolVersion &Sym : V.Globals)
-      if (hasWildcard(Sym.Name)) {
-        std::vector<SymbolBody *> All =
-            Sym.IsExternCpp ? findAllDemangled(Demangled, Sym.Name)
-                            : findAll(Sym.Name);
-
-        for (SymbolBody *B : All)
-          if (B->symbol()->VersionId == Config->DefaultSymbolVersion)
-            B->symbol()->VersionId = V.Id;
-      }
+    for (SymbolVersion &Sym : V.Globals) {
+      if (!hasWildcard(Sym.Name))
+        continue;
+      std::vector<SymbolBody *> All =
+          Sym.IsExternCpp ? findAllDemangled(Demangled, Sym.Name)
+                          : findAll(Sym.Name);
+
+      for (SymbolBody *B : All)
+        if (B->symbol()->VersionId == Config->DefaultSymbolVersion)
+          B->symbol()->VersionId = V.Id;
+    }
   }
 }