LibWeb: Move passed string in MimeType constructor

This was pointed out by Clang-Tidy and should avoid an allocation.
This commit is contained in:
Hendiadyoin1 2022-03-21 00:15:26 +01:00 committed by Andreas Kling
parent 6a95df2526
commit 6e921ae304
Notes: sideshowbarker 2024-07-18 04:38:32 +09:00

View File

@ -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 types parameters is an ordered map whose keys are ASCII strings and values are strings limited to HTTP quoted-string token code points.