1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 08:34:57 +00:00

AK: Add FlyString::equals_ignoring_ascii_case()

This is similar to equals_ignoring_case() but only cares about ASCII
case insensitivity.
This commit is contained in:
Andreas Kling 2023-03-07 19:53:21 +01:00
parent b78ee64415
commit 629b6462dc
2 changed files with 11 additions and 0 deletions

View file

@ -178,4 +178,12 @@ ErrorOr<void> Formatter<FlyString>::format(FormatBuilder& builder, FlyString con
return Formatter<StringView>::format(builder, fly_string.bytes_as_string_view());
}
bool FlyString::equals_ignoring_ascii_case(FlyString const& other) const
{
if (*this == other)
return true;
// FIXME: Rename StringUtils::equals_ignoring_case to equals_ignoring_ascii_case.
return StringUtils::equals_ignoring_case(bytes_as_string_view(), other.bytes_as_string_view());
}
}