summaryrefslogtreecommitdiff
path: root/AK
diff options
context:
space:
mode:
authorMatthew Olsson <matthewcolsson@gmail.com>2020-10-08 10:48:56 -0700
committerAndreas Kling <kling@serenityos.org>2020-10-08 23:27:16 +0200
commit67f23011509bfff835c22d5636425f8aded85763 (patch)
treeb2e8fce93d0a396130990a925a219a65f131d68e /AK
parent6e05685ad4cb06b53770d5759acc573aad4ede70 (diff)
downloadserenity-67f23011509bfff835c22d5636425f8aded85763.zip
AK: Make StringView hashable
Diffstat (limited to 'AK')
-rw-r--r--AK/StringView.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/AK/StringView.h b/AK/StringView.h
index 894b486546..6a0293561f 100644
--- a/AK/StringView.h
+++ b/AK/StringView.h
@@ -187,6 +187,11 @@ private:
size_t m_length { 0 };
};
+template<>
+struct Traits<StringView> : public GenericTraits<String> {
+ static unsigned hash(const StringView& s) { return s.hash(); }
+};
+
}
using AK::StringView;