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

AK: Make StringView::hash() constexpr

This required moving string_hash() to its own header so that everyone
can see it.
This commit is contained in:
Andreas Kling 2021-05-14 15:21:50 +02:00
parent 9c38475608
commit 3e603b2f32
5 changed files with 36 additions and 25 deletions

View file

@ -214,13 +214,6 @@ template Optional<u64> StringView::to_uint() const;
template Optional<long> StringView::to_uint() const;
template Optional<long long> StringView::to_uint() const;
unsigned StringView::hash() const
{
if (is_empty())
return 0;
return string_hash(characters_without_null_termination(), length());
}
bool StringView::operator==(const String& string) const
{
if (string.is_null())