mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 08:54:58 +00:00
AK: Move String::hash() and String::String() to StringBase
This commit is contained in:
parent
1b09a1851e
commit
d6290c4684
4 changed files with 16 additions and 16 deletions
|
@ -323,15 +323,6 @@ bool String::operator==(char const* c_string) const
|
|||
return bytes_as_string_view() == c_string;
|
||||
}
|
||||
|
||||
u32 String::hash() const
|
||||
{
|
||||
if (is_short_string()) {
|
||||
auto bytes = this->bytes();
|
||||
return string_hash(reinterpret_cast<char const*>(bytes.data()), bytes.size());
|
||||
}
|
||||
return m_data->hash();
|
||||
}
|
||||
|
||||
u32 String::ascii_case_insensitive_hash() const
|
||||
{
|
||||
return case_insensitive_string_hash(reinterpret_cast<char const*>(bytes().data()), bytes().size());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue