[ELF] Simplify. NFC
authorFangrui Song <maskray@google.com>
Tue, 22 May 2018 06:28:00 +0000 (06:28 +0000)
committerFangrui Song <maskray@google.com>
Tue, 22 May 2018 06:28:00 +0000 (06:28 +0000)
llvm-svn: 332952

lld/ELF/LTO.cpp

index 780c770..521657e 100644 (file)
@@ -155,8 +155,8 @@ BitcodeCompiler::BitcodeCompiler() {
   for (Symbol *Sym : Symtab->getSymbols()) {
     StringRef Name = Sym->getName();
     for (StringRef Prefix : {"__start_", "__stop_"})
-      if (Name.startswith(Prefix))
-        UsedStartStop.insert(Name.substr(Prefix.size()));
+      if (Name.consume_front(Prefix))
+        UsedStartStop.insert(Name);
   }
 }