fix two correctness bugs in the comparison logic

This commit is contained in:
Russell Sears 2020-05-07 15:50:40 -07:00
parent 945daf980d
commit 42950eba91
2 changed files with 2 additions and 2 deletions

View File

@ -70,7 +70,7 @@ public:
std::string shortString() const;
bool isValid() const { return part[0] || part[1]; }
bool compare(const UID& r) const {
int compare(const UID& r) const {
if (int cmp = ::compare(part[0], r.part[0])) {
return cmp;
}

View File

@ -713,7 +713,7 @@ int IndexedSet<T,Metric>::insert(const std::vector<std::pair<T,Metric>>& dataVec
bool foundNode = false;
while (true) {
int cmp = compare(data, t->data);
d = cmp >= 0;
d = cmp > 0;
if (!d)
blockEnd = t;
if (cmp == 0) {