From dd83634121d13fbbb66e1db9414c87a036926de2 Mon Sep 17 00:00:00 2001 From: Kenneth Myhra Date: Wed, 3 Sep 2025 19:13:30 +0200 Subject: [PATCH] LibWeb/FileAPI: Remove redundant if condition We have already verified above that options->type is not empty. --- Libraries/LibWeb/FileAPI/Blob.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Libraries/LibWeb/FileAPI/Blob.cpp b/Libraries/LibWeb/FileAPI/Blob.cpp index aa933795bf4..48a332bfd43 100644 --- a/Libraries/LibWeb/FileAPI/Blob.cpp +++ b/Libraries/LibWeb/FileAPI/Blob.cpp @@ -212,12 +212,9 @@ GC::Ref Blob::create(JS::Realm& realm, Optional con // FIXME: 2. Convert every character in t to ASCII lowercase. // NOTE: The spec is out of date, and we are supposed to call into the MimeType parser here. - if (!options->type.is_empty()) { - auto maybe_parsed_type = Web::MimeSniff::MimeType::parse(options->type); - - if (maybe_parsed_type.has_value()) - type = maybe_parsed_type->serialized(); - } + auto maybe_parsed_type = MimeSniff::MimeType::parse(options->type); + if (maybe_parsed_type.has_value()) + type = maybe_parsed_type->serialized(); } // 4. Return a Blob object referring to bytes as its associated byte sequence, with its size set to the length of bytes, and its type set to the value of t from the substeps above.