mirror of
https://github.com/RGBCube/serenity
synced 2025-05-15 07:14:58 +00:00
Everywhere: Add sv suffix to strings relying on StringView(char const*)
Each of these strings would previously rely on StringView's char const* constructor overload, which would call __builtin_strlen on the string. Since we now have operator ""sv, we can replace these with much simpler versions. This opens the door to being able to remove StringView(char const*). No functional changes.
This commit is contained in:
parent
e5f09ea170
commit
3f3f45580a
762 changed files with 8315 additions and 8316 deletions
|
@ -175,7 +175,7 @@ void HTMLObjectElement::resource_did_load()
|
|||
|
||||
// FIXME: For now, ignore application/ MIME types as we cannot render yet them anyways. We will need to implement the MIME type sniffing
|
||||
// algorithm in order to map all unknown MIME types to "application/octet-stream".
|
||||
else if (auto type = resource()->mime_type(); !type.starts_with("application/"))
|
||||
else if (auto type = resource()->mime_type(); !type.starts_with("application/"sv))
|
||||
tentative_type = move(type);
|
||||
|
||||
// 2. If tentative type is not application/octet-stream, then let resource type be tentative type and jump to the step below labeled handler.
|
||||
|
@ -195,7 +195,7 @@ static bool is_xml_mime_type(StringView resource_type)
|
|||
return false;
|
||||
|
||||
// An XML MIME type is any MIME type whose subtype ends in "+xml" or whose essence is "text/xml" or "application/xml". [RFC7303]
|
||||
if (mime_type->subtype().ends_with("+xml"))
|
||||
if (mime_type->subtype().ends_with("+xml"sv))
|
||||
return true;
|
||||
|
||||
return mime_type->essence().is_one_of("text/xml"sv, "application/xml"sv);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue