diff options
author | Clifford Wolf <clifford@clifford.at> | 2016-02-01 10:03:03 +0100 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2016-02-01 10:03:03 +0100 |
commit | ea492abcf01ee588a9756f8ae1f632ff418cd30c (patch) | |
tree | c514d4fe3ff1d13e43dc6807c157180e245d07ad /kernel | |
parent | 13e15a24a206f56d9daa15665aba4948fd5dfef5 (diff) | |
download | yosys-ea492abcf01ee588a9756f8ae1f632ff418cd30c.tar.gz yosys-ea492abcf01ee588a9756f8ae1f632ff418cd30c.tar.bz2 yosys-ea492abcf01ee588a9756f8ae1f632ff418cd30c.zip |
hashlib mfp<> performance improvements
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/hashlib.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/kernel/hashlib.h b/kernel/hashlib.h index f740fc50d..a31c62e56 100644 --- 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) |