1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 06:47:34 +00:00

LibELF: Convert more string literals to StringView literals.

Most of these won't have perf impact, but the optimization is
practically free, so no harm in fixing these up.
This commit is contained in:
Brian Gianforcaro 2021-02-24 05:41:50 -08:00 committed by Andreas Kling
parent ce1775d81d
commit 069fd58381
4 changed files with 17 additions and 17 deletions

View file

@ -76,9 +76,9 @@ StringView Image::section_index_to_string(unsigned index) const
{
VERIFY(m_valid);
if (index == SHN_UNDEF)
return "Undefined";
return "Undefined"sv;
if (index >= SHN_LORESERVE)
return "Reserved";
return "Reserved"sv;
return section(index).name();
}
@ -276,7 +276,7 @@ Image::Relocation Image::RelocationSection::relocation(unsigned index) const
Image::RelocationSection Image::Section::relocations() const
{
StringBuilder builder;
builder.append(".rel");
builder.append(".rel"sv);
builder.append(name());
auto relocation_section = m_image.lookup_section(builder.to_string());