switchbrew / switch-examples

Switch examples for devkitA64 and libnx.
https://devkitpro.org/viewforum.php?f=42
559 stars 99 forks source link

typo in rbtree remove #100

Closed scturtle closed 2 years ago

scturtle commented 2 years ago

https://github.com/switchbrew/switch-examples/blob/b55cb17676fddbfb90488366a8e1dd71c55804cb/graphics/deko3d/deko_examples/source/SampleFramework/CIntrusiveTree.cpp#L195

should be child = node->left() ? node->left() : node->right();

according to

https://github.com/devkitPro/libctru/blob/59cf50c2018ba86cbf44420f7c3cf4420deecba4/libctru/source/util/rbtree/rbtree_remove.c#L110-L113

scturtle commented 2 years ago

https://github.com/switchbrew/switch-examples/blob/b55cb17676fddbfb90488366a8e1dd71c55804cb/graphics/deko3d/deko_examples/source/SampleFramework/CIntrusiveTree.h#L176

shoud be bool empty() const { return m_root == nullptr; }

fincs commented 2 years ago

Thank you for spotting these. Feel free to submit a PR to fix them :)