LibWeb/FileAPI: Remove redundant if condition

We have already verified above that options->type is not empty.
This commit is contained in:
Kenneth Myhra 2025-09-03 19:13:30 +02:00 committed by Jelle Raaijmakers
commit dd83634121
Notes: github-actions[bot] 2025-09-03 19:44:58 +00:00

View file

@ -212,13 +212,10 @@ GC::Ref<Blob> Blob::create(JS::Realm& realm, Optional<BlobPartsOrByteBuffer> con
// FIXME: 2. Convert every character in t to ASCII lowercase. // 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. // 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 = MimeSniff::MimeType::parse(options->type);
auto maybe_parsed_type = Web::MimeSniff::MimeType::parse(options->type);
if (maybe_parsed_type.has_value()) if (maybe_parsed_type.has_value())
type = maybe_parsed_type->serialized(); 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. // 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.
return realm.create<Blob>(realm, move(byte_buffer), move(type)); return realm.create<Blob>(realm, move(byte_buffer), move(type));