diff --git a/ConflictSet.cpp b/ConflictSet.cpp index 434c5fd..96cfe97 100644 --- a/ConflictSet.cpp +++ b/ConflictSet.cpp @@ -464,21 +464,13 @@ void setChildrenParents(Node16 *n) { } void setChildrenParents(Node48 *n) { - for (int i = 0; i < 256; ++i) { - int c = n->index[i]; - if (c != -1) { - n->children[c].child->parent = n; - } - } + n->bitSet.forEachInRange( + [&](int i) { n->children[n->index[i]].child->parent = n; }, 0, 256); } void setChildrenParents(Node256 *n) { - for (int i = 0; i < 256; ++i) { - auto *child = n->children[i].child; - if (child != nullptr) { - child->parent = n; - } - } + n->bitSet.forEachInRange([&](int i) { n->children[i].child->parent = n; }, 0, + 256); } // Caller is responsible for assigning a non-null pointer to the returned