mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 12:35:14 +00:00
AK: Simplify Utf16View::operator==(Utf16View)
This commit is contained in:
parent
f0b3a06746
commit
87290e300e
Notes:
sideshowbarker
2024-07-18 03:12:19 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/87290e300ea
2 changed files with 1 additions and 16 deletions
|
@ -224,21 +224,6 @@ size_t Utf16View::calculate_length_in_code_points() const
|
|||
return code_points;
|
||||
}
|
||||
|
||||
bool Utf16View::operator==(Utf16View const& other) const
|
||||
{
|
||||
if (length_in_code_units() == 0)
|
||||
return other.length_in_code_units() == 0;
|
||||
if (length_in_code_units() != other.length_in_code_units())
|
||||
return false;
|
||||
|
||||
for (size_t i = 0; i < length_in_code_units(); ++i) {
|
||||
if (m_code_units[i] != other.m_code_units[i])
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Utf16View::equals_ignoring_case(Utf16View const& other) const
|
||||
{
|
||||
if (length_in_code_units() == 0)
|
||||
|
|
|
@ -70,7 +70,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
bool operator==(Utf16View const& other) const;
|
||||
bool operator==(Utf16View const& other) const { return m_code_units == other.m_code_units; }
|
||||
|
||||
enum class AllowInvalidCodeUnits {
|
||||
Yes,
|
||||
|
|
Loading…
Add table
Reference in a new issue