Remove depth-based error-recovery pruning criteria

This code was causing ambiguities to get resolved differently depending on
whether there was an unrelated error on the stack or not.
This commit is contained in:
Max Brunsfeld 2017-08-09 09:53:41 -07:00
parent 96a2b05289
commit 9d649f3382

View file

@ -2,7 +2,6 @@
static const unsigned MAX_COST_DIFFERENCE = 16 * ERROR_COST_PER_SKIPPED_TREE;
static const unsigned MAX_PUSH_COUNT_WITH_COUNT_DIFFERENCE = 24;
static const unsigned MAX_DEPTH_TO_ALLOW_MULTIPLE = 12;
ErrorComparison error_status_compare(ErrorStatus a, ErrorStatus b, bool are_mergeable) {
if (a.count < b.count) {
@ -43,14 +42,5 @@ ErrorComparison error_status_compare(ErrorStatus a, ErrorStatus b, bool are_merg
}
}
if (a.count > 0) {
if (a.depth > MAX_DEPTH_TO_ALLOW_MULTIPLE ||
b.depth > MAX_DEPTH_TO_ALLOW_MULTIPLE) {
return a.depth <= b.depth ?
ErrorComparisonTakeLeft :
ErrorComparisonTakeRight;
}
}
return ErrorComparisonNone;
}