forked from OSchip/llvm-project
[llvm-readobj] Check ELFType value first when checking for OpenBSD notes.
Checking ELFType == ELF::ET_CORE first skips string comparison for the majority of cases. Suggested by Fangrui Song in D114635 for a similar construct.
This commit is contained in:
parent
ab9078f3d3
commit
f6ba5c4d5f
|
@ -5492,7 +5492,7 @@ StringRef getNoteTypeName(const typename ELFT::Note &Note, unsigned ELFType) {
|
|||
return Result;
|
||||
return FindNote(CoreNoteTypes);
|
||||
}
|
||||
if (Name.startswith("OpenBSD") && ELFType == ELF::ET_CORE) {
|
||||
if (ELFType == ELF::ET_CORE && Name.startswith("OpenBSD")) {
|
||||
// OpenBSD also places the generic core notes in the OpenBSD namespace.
|
||||
StringRef Result = FindNote(OpenBSDCoreNoteTypes);
|
||||
if (!Result.empty())
|
||||
|
|
Loading…
Reference in New Issue