1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 23:37:35 +00:00

AK+Kernel: StringView hash map Traits should not set peek type to String

This typo / bug in the Traits<T> implementation for StringView caused
AK::HashMap methods to return a `String` when looking up values out of
a hash map of type HashTable<StringView,StringView>.

This change fixes the typo, and fixes the only consumer, the kernel
Commandline class.
This commit is contained in:
Brian Gianforcaro 2021-08-14 23:49:17 -07:00 committed by Andreas Kling
parent 9bdb44c5d2
commit e9d8f158a1
3 changed files with 8 additions and 8 deletions

View file

@ -228,7 +228,7 @@ private:
};
template<>
struct Traits<StringView> : public GenericTraits<String> {
struct Traits<StringView> : public GenericTraits<StringView> {
static unsigned hash(const StringView& s) { return s.hash(); }
};