summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorNico Weber <thakis@chromium.org>2023-02-19 07:07:58 -0500
committerAndreas Kling <kling@serenityos.org>2023-02-19 23:46:36 +0100
commit937d018fc61a54199619605101b7d9abbfc5dd94 (patch)
tree7014fbb58da5916fa5e98c1b00590e1046346b32 /Userland/Libraries
parent81793270680680ae04dd60f270cec9e29939d5eb (diff)
downloadserenity-937d018fc61a54199619605101b7d9abbfc5dd94.zip
LibGfx: Use ICC::Profile::try_for_each_tag in encode_tag_datas()
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibGfx/ICC/BinaryWriter.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/Userland/Libraries/LibGfx/ICC/BinaryWriter.cpp b/Userland/Libraries/LibGfx/ICC/BinaryWriter.cpp
index 22841e4624..5aa810cb01 100644
--- a/Userland/Libraries/LibGfx/ICC/BinaryWriter.cpp
+++ b/Userland/Libraries/LibGfx/ICC/BinaryWriter.cpp
@@ -305,14 +305,14 @@ static ErrorOr<Vector<ByteBuffer>> encode_tag_datas(Profile const& profile, Hash
Vector<ByteBuffer> tag_data_bytes;
TRY(tag_data_bytes.try_ensure_capacity(profile.tag_count()));
- profile.for_each_tag([&](auto, auto tag_data) {
+ TRY(profile.try_for_each_tag([&](auto, auto tag_data) -> ErrorOr<void> {
if (tag_data_map.contains(tag_data.ptr()))
- return;
+ return {};
- // FIXME: Come up with a way to allow TRY instead of MUST here.
- tag_data_bytes.append(MUST(encode_tag_data(tag_data)));
- MUST(tag_data_map.try_set(tag_data.ptr(), tag_data_bytes.size() - 1));
- });
+ tag_data_bytes.append(TRY(encode_tag_data(tag_data)));
+ TRY(tag_data_map.try_set(tag_data.ptr(), tag_data_bytes.size() - 1));
+ return {};
+ }));
return tag_data_bytes;
}