mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 19:59:17 +00:00
AK: Make ""_string and ""_fly_string literals skip UTF-8 validation
We still validate in an ASSERT, but let's not bother with this in release builds.
This commit is contained in:
parent
f070264800
commit
697e87b7bd
Notes:
github-actions[bot]
2025-04-09 05:23:19 +00:00
Author: https://github.com/awesomekling
Commit: 697e87b7bd
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4289
Reviewed-by: https://github.com/Hendiadyoin1
2 changed files with 4 additions and 2 deletions
|
@ -217,7 +217,8 @@ struct ASCIICaseInsensitiveFlyStringTraits : public Traits<String> {
|
|||
|
||||
[[nodiscard]] ALWAYS_INLINE AK::FlyString operator""_fly_string(char const* cstring, size_t length)
|
||||
{
|
||||
return AK::FlyString::from_utf8(AK::StringView(cstring, length)).release_value();
|
||||
ASSERT(Utf8View(AK::StringView(cstring, length)).validate());
|
||||
return AK::FlyString::from_utf8_without_validation({ cstring, length });
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
|
|
|
@ -354,5 +354,6 @@ struct ASCIICaseInsensitiveStringTraits : public Traits<String> {
|
|||
|
||||
[[nodiscard]] ALWAYS_INLINE AK::String operator""_string(char const* cstring, size_t length)
|
||||
{
|
||||
return AK::String::from_utf8(AK::StringView(cstring, length)).release_value();
|
||||
ASSERT(Utf8View(AK::StringView(cstring, length)).validate());
|
||||
return AK::String::from_utf8_without_validation({ cstring, length });
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue