[ObjCopy] Use StringRef::starts_with (NFC) (#139408)

This commit is contained in:
Kazu Hirata 2025-05-10 16:04:45 -07:00 committed by GitHub
parent 8e2a9fa9a5
commit d4e730f49b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -352,8 +352,7 @@ static Error updateAndRemoveSymbols(const CommonConfig &Config,
Sym.Name = std::string(I->getValue());
if (!Config.SymbolsPrefixRemove.empty() && Sym.Type != STT_SECTION)
if (Sym.Name.compare(0, Config.SymbolsPrefixRemove.size(),
Config.SymbolsPrefixRemove) == 0)
if (StringRef(Sym.Name).starts_with(Config.SymbolsPrefixRemove))
Sym.Name = Sym.Name.substr(Config.SymbolsPrefixRemove.size());
if (!Config.SymbolsPrefix.empty() && Sym.Type != STT_SECTION)