Avoid deep tree comparison when both trees have errors
This commit is contained in:
parent
c53f9bcbd9
commit
8f028ebf68
3 changed files with 5 additions and 2 deletions
|
|
@ -452,6 +452,8 @@ static bool parser__select_tree(Parser *self, Tree *left, Tree *right) {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (left->error_cost > 0) return -1;
|
||||
|
||||
int comparison = ts_tree_compare(left, right);
|
||||
switch (comparison) {
|
||||
case -1:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue