mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 08:14:58 +00:00
AK: Make CaseInsensitiveStringTraits allocation-free
Instead of calling String::to_lowercase(), do case-insensitive hashing and comparison.
This commit is contained in:
parent
1b6ed558bb
commit
2dd3b54827
3 changed files with 9 additions and 2 deletions
|
@ -133,6 +133,11 @@ NonnullRefPtr<StringImpl> StringImpl::to_uppercase() const
|
|||
return const_cast<StringImpl&>(*this);
|
||||
}
|
||||
|
||||
unsigned StringImpl::case_insensitive_hash() const
|
||||
{
|
||||
return case_insensitive_string_hash(characters(), length());
|
||||
}
|
||||
|
||||
void StringImpl::compute_hash() const
|
||||
{
|
||||
if (!length())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue