mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-08 09:09:43 +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
cd72e788e9
commit
dfade03777
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)
|
[[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
|
#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)
|
[[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