mirror of
https://github.com/YosysHQ/yosys
synced 2025-06-06 14:13:23 +00:00
hashlib: fixes from jix
This commit is contained in:
parent
ed70038aa1
commit
026e9dae9d
4 changed files with 15 additions and 15 deletions
|
@ -264,7 +264,11 @@ struct hash_obj_ops {
|
|||
}
|
||||
template<typename T>
|
||||
static inline Hasher hash_into(const T *a, Hasher h) {
|
||||
return a ? a->hash_into(h) : h;
|
||||
if (a)
|
||||
a->hash_into(h);
|
||||
else
|
||||
h.eat(0);
|
||||
return h;
|
||||
}
|
||||
};
|
||||
/**
|
||||
|
@ -785,13 +789,13 @@ public:
|
|||
}
|
||||
|
||||
Hasher hash_into(Hasher h) const {
|
||||
h.eat(entries.size());
|
||||
for (auto &it : entries) {
|
||||
Hasher entry_hash;
|
||||
entry_hash.eat(it.udata.first);
|
||||
entry_hash.eat(it.udata.second);
|
||||
h.commutative_eat(entry_hash.yield());
|
||||
}
|
||||
h.eat(entries.size());
|
||||
return h;
|
||||
}
|
||||
|
||||
|
@ -1155,10 +1159,10 @@ public:
|
|||
}
|
||||
|
||||
Hasher hash_into(Hasher h) const {
|
||||
h.eat(entries.size());
|
||||
for (auto &it : entries) {
|
||||
h.commutative_eat(ops.hash(it.udata).yield());
|
||||
}
|
||||
h.eat(entries.size());
|
||||
return h;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue