projects
/
yosys.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bce0bb6
)
Add hashlib support for hashing of pools
author
Clifford Wolf
<clifford@clifford.at>
Tue, 22 Aug 2017 11:04:33 +0000
(13:04 +0200)
committer
Clifford Wolf
<clifford@clifford.at>
Tue, 22 Aug 2017 11:04:33 +0000
(13:04 +0200)
kernel/hashlib.h
patch
|
blob
|
history
diff --git
a/kernel/hashlib.h
b/kernel/hashlib.h
index 63ac956f21d8ff78bf1168c9377ff8ba585ab149..df534ec1bbde3229f33e3ee0c3fa47feec68817f 100644
(file)
--- a/
kernel/hashlib.h
+++ b/
kernel/hashlib.h
@@
-868,6
+868,13
@@
public:
return !operator==(other);
}
+ bool hash() const {
+ unsigned int hashval = mkhash_init;
+ for (auto &it : entries)
+ hashval ^= ops.hash(it.udata);
+ return hashval;
+ }
+
void reserve(size_t n) { entries.reserve(n); }
size_t size() const { return entries.size(); }
bool empty() const { return entries.empty(); }