util/tree: fix FirstNode

This commit is contained in:
Edgaru089 2021-11-08 01:32:30 +08:00
parent e38a61a61a
commit ebbe907bb7

View File

@ -134,7 +134,7 @@ tree_Node *tree_FirstNode(tree_Tree *tree) {
tree_Node *result = tree->root; tree_Node *result = tree->root;
if (!result) if (!result)
return 0; return 0;
while (result->right) while (result->left)
result = result->left; result = result->left;
return result; return result;
} }