|
|
@@ -5,6 +5,7 @@
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
+#include "core/murmur.h"
|
|
|
#include "core/strings/string.inl"
|
|
|
#include "core/strings/string_view.h"
|
|
|
|
|
|
@@ -74,4 +75,13 @@ inline bool operator<(const StringView &a, const StringView &b)
|
|
|
return cmp < 0 || (cmp == 0 && a._length < b._length);
|
|
|
}
|
|
|
|
|
|
+template<>
|
|
|
+struct hash<StringView>
|
|
|
+{
|
|
|
+ u32 operator()(const StringView &val) const
|
|
|
+ {
|
|
|
+ return (u32)murmur64(val._data, val._length, 0);
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
} // namespace crown
|