From 0cea9333ac85d372cfa4be639e2fa4148153b3dc Mon Sep 17 00:00:00 2001 From: Peter LaFosse Date: Tue, 14 Jan 2025 11:48:39 -0500 Subject: Add hash for XrefItem --- ui/xreflist.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ui/xreflist.h b/ui/xreflist.h index e9df2df8..ea1ce610 100644 --- a/ui/xreflist.h +++ b/ui/xreflist.h @@ -117,6 +117,17 @@ class XrefItem int row() const; bool operator==(const XrefItem& other) const; bool operator!=(const XrefItem& other) const; + size_t operator()(const XrefItem& item) const + { + size_t hash = std::hash()(item.addr()); + hash ^= std::hash()(item.type()) + 0x9e3779b9 + (hash << 6) + (hash >> 2); + hash ^= std::hash()(item.direction()) + 0x9e3779b9 + (hash << 6) + (hash >> 2); + hash ^= std::hash()(item.kind()) + 0x9e3779b9 + (hash << 6) + (hash >> 2); + hash ^= std::hash()(item.instrId()) + 0x9e3779b9 + (hash << 6) + (hash >> 2); + hash ^= std::hash()(item.func() ? item.func()->GetStart() : 0) + 0x9e3779b9 + (hash << 6) + (hash >> 2); + hash ^= std::hash()(item.ilType()) + 0x9e3779b9 + (hash << 6) + (hash >> 2); + return hash; + } }; /*! -- cgit v1.3.1