projects
/
yosys.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
13e15a2
)
hashlib mfp<> performance improvements
author
Clifford Wolf
<clifford@clifford.at>
Mon, 1 Feb 2016 09:03:03 +0000
(10:03 +0100)
committer
Clifford Wolf
<clifford@clifford.at>
Mon, 1 Feb 2016 09:03:03 +0000
(10:03 +0100)
kernel/hashlib.h
patch
|
blob
|
history
diff --git
a/kernel/hashlib.h
b/kernel/hashlib.h
index f740fc50d6d93578e93ed6b9b2444b0cfc7c02c2..a31c62e5661e167cf87387b244f386678510a3ab 100644
(file)
--- a/
kernel/hashlib.h
+++ b/
kernel/hashlib.h
@@
-1015,7
+1015,10
@@
public:
const K &find(const K &a) const
{
- return (*this)[ifind((*this)(a))];
+ int i = database.at(a, -1);
+ if (i < 0)
+ return a;
+ return (*this)[ifind(i)];
}
void merge(const K &a, const K &b)
@@
-1025,7
+1028,9
@@
public:
void promote(const K &a)
{
- ipromote((*this)(a));
+ int i = database.at(a, -1);
+ if (i >= 0)
+ ipromote(i);
}
void swap(mfp &other)