diff --git a/ConflictSet.cpp b/ConflictSet.cpp index a690e6e..0b69e9e 100644 --- a/ConflictSet.cpp +++ b/ConflictSet.cpp @@ -2798,20 +2798,10 @@ Node **insert(Node **self, std::span key, assert(maxVersion(*self, impl) <= writeVersion); setMaxVersion(*self, impl, writeVersion); - for (;; ++tls->accum.insert_iterations) { - - if (key.size() == 0) { - return self; - } - - bool existed = getChild(*self, key.front()); - auto &child = getOrCreateChild(*self, key, writeVersion, tls); - if (!existed) { - return &child; - } - - self = &child; + for (; key.size() != 0; ++tls->accum.insert_iterations) { + self = &getOrCreateChild(*self, key, writeVersion, tls); } + return self; } void destroyTree(Node *root) {