From b6359b211d59c71c6363db4eff73eb01a1c830a3 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 20 Nov 2021 16:18:28 +0100 Subject: [PATCH] LibGfx: Use StringView for header constants in the GIF decoder --- Userland/Libraries/LibGfx/GIFLoader.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Userland/Libraries/LibGfx/GIFLoader.cpp b/Userland/Libraries/LibGfx/GIFLoader.cpp index 00892eb61a..2dbe15484c 100644 --- a/Userland/Libraries/LibGfx/GIFLoader.cpp +++ b/Userland/Libraries/LibGfx/GIFLoader.cpp @@ -87,8 +87,8 @@ enum class GIFFormat { static Optional decode_gif_header(InputMemoryStream& stream) { - static const char valid_header_87[] = "GIF87a"; - static const char valid_header_89[] = "GIF89a"; + static auto valid_header_87 = "GIF87a"sv; + static auto valid_header_89 = "GIF89a"sv; Array header; stream >> header; @@ -96,9 +96,9 @@ static Optional decode_gif_header(InputMemoryStream& stream) if (stream.handle_any_error()) return {}; - if (header.span() == ReadonlyBytes { valid_header_87, 6 }) + if (header.span() == valid_header_87.bytes()) return GIFFormat::GIF87a; - if (header.span() == ReadonlyBytes { valid_header_89, 6 }) + if (header.span() == valid_header_89.bytes()) return GIFFormat::GIF89a; return {};