From 6e921ae304f87a19b1c1a9818481d8af36d09a91 Mon Sep 17 00:00:00 2001 From: Hendiadyoin1 Date: Mon, 21 Mar 2022 00:15:26 +0100 Subject: [PATCH] LibWeb: Move passed string in MimeType constructor This was pointed out by Clang-Tidy and should avoid an allocation. --- Userland/Libraries/LibWeb/MimeSniff/MimeType.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibWeb/MimeSniff/MimeType.cpp b/Userland/Libraries/LibWeb/MimeSniff/MimeType.cpp index f19ed86551..ae13e676de 100644 --- a/Userland/Libraries/LibWeb/MimeSniff/MimeType.cpp +++ b/Userland/Libraries/LibWeb/MimeSniff/MimeType.cpp @@ -26,8 +26,8 @@ static bool contains_only_http_quoted_string_token_code_points(StringView string } MimeType::MimeType(String type, String subtype) - : m_type(type) - , m_subtype(subtype) + : m_type(move(type)) + , m_subtype(move(subtype)) { // https://mimesniff.spec.whatwg.org/#parameters // A MIME type’s parameters is an ordered map whose keys are ASCII strings and values are strings limited to HTTP quoted-string token code points.