Fix regression in subtree_compare
This commit is contained in:
parent
6b2879144f
commit
ce5afeb4b3
1 changed files with 3 additions and 3 deletions
|
|
@ -629,9 +629,9 @@ int ts_subtree_compare(Subtree left, Subtree right, SubtreePool *pool) {
|
|||
|
||||
int result = 0;
|
||||
if (ts_subtree_symbol(left) < ts_subtree_symbol(right)) result = -1;
|
||||
if (ts_subtree_symbol(right) < ts_subtree_symbol(left)) result = 1;
|
||||
if (ts_subtree_child_count(left) < ts_subtree_child_count(right)) result = -1;
|
||||
if (ts_subtree_child_count(right) < ts_subtree_child_count(left)) result = 1;
|
||||
else if (ts_subtree_symbol(right) < ts_subtree_symbol(left)) result = 1;
|
||||
else if (ts_subtree_child_count(left) < ts_subtree_child_count(right)) result = -1;
|
||||
else if (ts_subtree_child_count(right) < ts_subtree_child_count(left)) result = 1;
|
||||
if (result != 0) {
|
||||
array_clear(&pool->tree_stack);
|
||||
return result;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue