Fix assert fail.

Summary: Assert fail introduced by me, by incorrectly fixing skiplist find_or_larger.

Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D349
This commit is contained in:
Dominik Gleich 2017-05-05 11:33:45 +02:00
parent 1333bfeb39
commit 3428a9bfbd

View File

@ -796,9 +796,7 @@ class SkipList : private Lockable<lock_t> {
while (true) {
// try to descend down first while the next key on this layer overshoots
// or the next key is marked for deletion
for (; h >= 0 && (less(item, node = pred->forward(h)) ||
(node && node->flags.is_marked()));
--h) {
for (; h >= 0 && less(item, node = pred->forward(h)); --h) {
}
// if we overshoot at every layer, item doesn't exist
@ -809,7 +807,10 @@ class SkipList : private Lockable<lock_t> {
while (greater(item, node)) pred = node, node = node->forward(h);
// check if we have a hit. if not, we need to descend down again
if (!less(item, node) && !node->flags.is_marked()) return It(node);
if (!less(item, node)) {
if (!node->flags.is_marked()) return It(node);
return It(nullptr);
}
}
}