[BOLT] Use StringRef::starts_with (NFC) (#139437)

This commit is contained in:
Kazu Hirata
2025-05-11 07:13:02 -07:00
committed by GitHub
parent b4eafbcae6
commit 074c420496

View File

@@ -78,8 +78,7 @@ Error BuildIDRewriter::sectionInitializer() {
"out of bounds while reading note section: %s",
toString(Cursor.takeError()).c_str());
if (Type == ELF::NT_GNU_BUILD_ID && Name.substr(0, 3) == "GNU" &&
DescSz) {
if (Type == ELF::NT_GNU_BUILD_ID && Name.starts_with("GNU") && DescSz) {
BuildIDSection = NoteSection;
BuildID = Desc;
BC.setFileBuildID(getPrintableBuildID(Desc));