Use forEachInRange for overfill for Node48
This commit is contained in:
@@ -558,12 +558,11 @@ Node *&getOrCreateChild(Node *&self, uint8_t index,
|
||||
auto *newSelf = allocators->node256.allocate();
|
||||
memcpy((void *)newSelf, self, offsetof(Node, type));
|
||||
newSelf->bitSet = self48->bitSet;
|
||||
for (int i = 0; i < 256; ++i) {
|
||||
int c = self48->index[i];
|
||||
if (c >= 0) {
|
||||
newSelf->children[i] = self48->children[c];
|
||||
}
|
||||
}
|
||||
newSelf->bitSet.forEachInRange(
|
||||
[&](int i) {
|
||||
newSelf->children[i] = self48->children[self48->index[i]];
|
||||
},
|
||||
0, 256);
|
||||
allocators->node48.release(self48);
|
||||
setChildrenParents(newSelf);
|
||||
self = newSelf;
|
||||
|
Reference in New Issue
Block a user