[lld] 101407b - [ELF] parseSymbolVersion: remove unussed pos == 0 check

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 16 00:00:00 PST 2021


Author: Fangrui Song
Date: 2021-12-15T23:59:55-08:00
New Revision: 101407bfaa9e3b27384fbd9cebc6d5b6018195bc

URL: https://github.com/llvm/llvm-project/commit/101407bfaa9e3b27384fbd9cebc6d5b6018195bc
DIFF: https://github.com/llvm/llvm-project/commit/101407bfaa9e3b27384fbd9cebc6d5b6018195bc.diff

LOG: [ELF] parseSymbolVersion: remove unussed pos == 0 check

Added: 
    

Modified: 
    lld/ELF/Symbols.cpp

Removed: 
    


################################################################################
diff  --git a/lld/ELF/Symbols.cpp b/lld/ELF/Symbols.cpp
index 93609fc1f283..807a020d1384 100644
--- a/lld/ELF/Symbols.cpp
+++ b/lld/ELF/Symbols.cpp
@@ -214,7 +214,7 @@ void Symbol::parseSymbolVersion() {
     return;
   StringRef s = getName();
   size_t pos = s.find('@');
-  if (pos == 0 || pos == StringRef::npos)
+  if (pos == StringRef::npos)
     return;
   StringRef verstr = s.substr(pos + 1);
   if (verstr.empty())


        


More information about the llvm-commits mailing list