mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:47:35 +00:00
LibELF: Remove sketchy use of "undefined" ELF::Image::Section
We were using ELF::Image::section(0) to indicate the "undefined" section, when what we really wanted was just Optional<Section>. So let's use Optional instead. :^)
This commit is contained in:
parent
f70d0f03de
commit
16221305ad
6 changed files with 18 additions and 19 deletions
|
@ -176,10 +176,10 @@ Icon FileIconProvider::icon_for_executable(const String& path)
|
|||
auto section = image.lookup_section(icon_section.section_name);
|
||||
|
||||
RefPtr<Gfx::Bitmap> bitmap;
|
||||
if (section.is_undefined()) {
|
||||
if (!section.has_value()) {
|
||||
bitmap = s_executable_icon.bitmap_for_size(icon_section.image_size);
|
||||
} else {
|
||||
bitmap = Gfx::load_png_from_memory(reinterpret_cast<const u8*>(section.raw_data()), section.size());
|
||||
bitmap = Gfx::load_png_from_memory(reinterpret_cast<u8 const*>(section->raw_data()), section->size());
|
||||
}
|
||||
|
||||
if (!bitmap) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue