fix two correctness bugs in the comparison logic
This commit is contained in:
parent
945daf980d
commit
42950eba91
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue