From 006dff6878a6dabc34ddb1513e6228e460ad1818 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Tue, 14 Feb 2023 12:57:11 -0500 Subject: [PATCH] LibGfx: Move ICC::Profile::read_tag() out of class --- Userland/Libraries/LibGfx/ICC/Profile.cpp | 4 ++-- Userland/Libraries/LibGfx/ICC/Profile.h | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Userland/Libraries/LibGfx/ICC/Profile.cpp b/Userland/Libraries/LibGfx/ICC/Profile.cpp index dbca16f71e0..0f640da3f24 100644 --- a/Userland/Libraries/LibGfx/ICC/Profile.cpp +++ b/Userland/Libraries/LibGfx/ICC/Profile.cpp @@ -603,7 +603,7 @@ ErrorOr Profile::read_header(ReadonlyBytes bytes) return {}; } -ErrorOr> Profile::read_tag(ReadonlyBytes bytes, u32 offset_to_beginning_of_tag_data_element, u32 size_of_tag_data_element) +static ErrorOr> read_tag(ReadonlyBytes bytes, u32 offset_to_beginning_of_tag_data_element, u32 size_of_tag_data_element) { // "All tag data elements shall start on a 4-byte boundary (relative to the start of the profile data stream)" if (offset_to_beginning_of_tag_data_element % 4 != 0) @@ -709,7 +709,7 @@ ErrorOr Profile::read_tag_table(ReadonlyBytes bytes) // FIXME: optionally ignore tags with unknown signature // Dedupe identical offset/sizes. - NonnullRefPtr tag_data = TRY(offset_to_tag_data.try_ensure(tag_table_entries[i].offset_to_beginning_of_tag_data_element, [=, this]() { + NonnullRefPtr tag_data = TRY(offset_to_tag_data.try_ensure(tag_table_entries[i].offset_to_beginning_of_tag_data_element, [&]() { return read_tag(bytes, tag_table_entries[i].offset_to_beginning_of_tag_data_element, tag_table_entries[i].size_of_tag_data_element); })); diff --git a/Userland/Libraries/LibGfx/ICC/Profile.h b/Userland/Libraries/LibGfx/ICC/Profile.h index d2e8a814f38..d3474d9ac0c 100644 --- a/Userland/Libraries/LibGfx/ICC/Profile.h +++ b/Userland/Libraries/LibGfx/ICC/Profile.h @@ -226,7 +226,6 @@ public: private: ErrorOr read_header(ReadonlyBytes); - ErrorOr> read_tag(ReadonlyBytes bytes, u32 offset_to_beginning_of_tag_data_element, u32 size_of_tag_data_element); ErrorOr read_tag_table(ReadonlyBytes); ErrorOr check_required_tags(); ErrorOr check_tag_types();