hashlib mfp<> performance improvements

This commit is contained in:
Clifford Wolf 2016-02-01 10:03:03 +01:00
parent 13e15a24a2
commit ea492abcf0
1 changed files with 7 additions and 2 deletions

View File

@ -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)