summaryrefslogtreecommitdiff
path: root/apt-pkg/pkgcachegen.h
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg/pkgcachegen.h')
-rw-r--r--apt-pkg/pkgcachegen.h8
1 files changed, 3 insertions, 5 deletions
diff --git a/apt-pkg/pkgcachegen.h b/apt-pkg/pkgcachegen.h
index f5b4c80b3..9a88b45e7 100644
--- a/apt-pkg/pkgcachegen.h
+++ b/apt-pkg/pkgcachegen.h
@@ -29,6 +29,8 @@
#endif
#include <apt-pkg/string_view.h>
+#include <xxhash.h>
+
class FileFd;
class pkgSourceList;
class OpProgress;
@@ -63,11 +65,7 @@ class APT_HIDDEN pkgCacheGenerator /*{{{*/
};
struct hash {
uint32_t operator()(string_pointer const &that) const {
- uint32_t Hash = 5381;
- const char * const end = that.data() + that.size;
- for (const char *I = that.data(); I != end; ++I)
- Hash = 33 * Hash + *I;
- return Hash;
+ return XXH3_64bits(that.data(), that.size) & 0xFFFFFFFF;
}
};