Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Ladybird: A new cross-platform browser project. Parent comment
Iteration on array is faster (cache locality) than DL list traversal. And there are issues when you traverse tree while changing it.
In any case I've found that storing child nodes as m_children collection is more convenient in many cases. At least in Sciter (https://sciter.com).
struct node { weak_ref<element> m_parent; uint m_node_index; } struct element : node { vector<ref<node>> m_children; // strict ownership, sic! }
There are no comments on this comment yet.
Iteration on array is faster (cache locality) than DL list traversal. And there are issues when you traverse tree while changing it.
In any case I've found that storing child nodes as m_children collection is more convenient in many cases. At least in Sciter (https://sciter.com).