// All trees have same height, just create parent nodes.
while (length > 3) {
for (let i = 0; i < newLength; i++) {
const j = i << 1;
items[i] = ListAstNode.create23(items[j], items[j + 1], j + 3 === length ? items[j + 2] : null, createImmutableLists);
}
length = newLength;
}
return ListAstNode.create23(items[0], items[1], length >= 3 ? items[2] : null, createImmutableLists);
}