11 Nov
2022
11 Nov
'22
7:21 p.m.
On Fri Nov 11 19:17:33 2022 +0000, Esme Povirk wrote:
I think in practice if you can handle 2 children this way, you can handle many children. I was thinking something like this would work:
add_child(parent, child):
prev_last_child = parent->last_child
parent->last_child = child
child->parent = parent
if (prev_last_child):
prev_last_child->next_sibling = child
child->prev_sibling = prev_last_child
else:
parent->first_child = child
But it now occurs to me that you could special-case it to only handle up to 2 children. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/1249#note_14098