Use forEachInRange in setChildrenParents
This commit is contained in:
@@ -464,21 +464,13 @@ void setChildrenParents(Node16 *n) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void setChildrenParents(Node48 *n) {
|
void setChildrenParents(Node48 *n) {
|
||||||
for (int i = 0; i < 256; ++i) {
|
n->bitSet.forEachInRange(
|
||||||
int c = n->index[i];
|
[&](int i) { n->children[n->index[i]].child->parent = n; }, 0, 256);
|
||||||
if (c != -1) {
|
|
||||||
n->children[c].child->parent = n;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void setChildrenParents(Node256 *n) {
|
void setChildrenParents(Node256 *n) {
|
||||||
for (int i = 0; i < 256; ++i) {
|
n->bitSet.forEachInRange([&](int i) { n->children[i].child->parent = n; }, 0,
|
||||||
auto *child = n->children[i].child;
|
256);
|
||||||
if (child != nullptr) {
|
|
||||||
child->parent = n;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Caller is responsible for assigning a non-null pointer to the returned
|
// Caller is responsible for assigning a non-null pointer to the returned
|
||||||
|
Reference in New Issue
Block a user