Skip to content

Commit f499afc

Browse files
committed
fix effect_relation_hash
1 parent 3b6342b commit f499afc

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

card.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,9 @@ class card {
113113
public:
114114
struct effect_relation_hash {
115115
std::size_t operator()(const std::pair<effect*, uint16_t>& v) const {
116-
return std::hash<uint16_t>()(v.second);
116+
std::size_t h1 = std::hash<effect*>()(v.first);
117+
std::size_t h2 = std::hash<uint16_t>()(v.second);
118+
return h1 ^ (h2 << 1);
117119
}
118120
};
119121
using effect_relation = std::unordered_set<std::pair<effect*, uint16_t>, effect_relation_hash>;

0 commit comments

Comments
 (0)