AK+LibWeb: Add a UTF-16 starts/ends with wrapper for a single code unit

This commit is contained in:
Timothy Flynn 2025-08-06 07:43:11 -04:00 committed by Jelle Raaijmakers
commit 1bc80848fb
Notes: github-actions[bot] 2025-08-07 00:07:32 +00:00
8 changed files with 26 additions and 9 deletions

View file

@ -1615,7 +1615,7 @@ static bool is_valid_simple_color(Utf16View const& value)
if (value.length_in_code_units() != 7)
return false;
// and the first character is a U+0023 NUMBER SIGN character (#),
if (!value.starts_with("#"sv))
if (!value.starts_with('#'))
return false;
// and the remaining six characters are all ASCII hex digits
for (size_t i = 1; i < value.length_in_code_units(); i++)