From: Clifford Wolf Date: Mon, 1 Feb 2016 09:03:03 +0000 (+0100) Subject: hashlib mfp<> performance improvements X-Git-Tag: yosys-0.6~28 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ea492abcf01ee588a9756f8ae1f632ff418cd30c;p=yosys.git hashlib mfp<> performance improvements --- 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)