From 593657c9aa94545a48a17372b97e5d2c75774bbd Mon Sep 17 00:00:00 2001 From: Andrew Noyes Date: Fri, 9 Feb 2024 15:32:06 -0800 Subject: [PATCH] Remove duplicate code --- ConflictSet.cpp | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/ConflictSet.cpp b/ConflictSet.cpp index ae844da..16fa1c0 100644 --- a/ConflictSet.cpp +++ b/ConflictSet.cpp @@ -485,21 +485,6 @@ Node *nextPhysical(Node *node) { } } -Node *nextPhysicalSkipSubtree(Node *node) { - int index = -1; - for (;;) { - index = node->parentsIndex; - node = node->parent; - if (node == nullptr) { - return nullptr; - } - auto nextChild = getChildGeq(node, index + 1); - if (nextChild >= 0) { - return getChildExists(node, nextChild); - } - } -} - Node *nextLogical(Node *node) { for (node = nextPhysical(node); node != nullptr && !node->entryPresent; node = nextPhysical(node)) @@ -792,7 +777,8 @@ bool checkRangeRead(Node *n, const std::span begin, if (iter->maxVersion > readVersion) { return false; } - iter = nextPhysicalSkipSubtree(iter); + // Skip subtree + iter = nextSibling(iter); } else { if (onRightPath && iter->maxVersion <= readVersion) { return true;