Skip to content
Myr

Fix divide by zero error with --tiebreak=end for long items

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Fix #3846

authored by Junegunn Choi · committed by Junegunn Choi · parent 9b0e2da · Browse files · 1 file+1 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−1 removed

  • other:+1 added−1 removed

1 file+1 added−1 removed

modified:src/result.go+1 added-1 removed
79 unmodified lines
80 }81 if criterion == byBegin {82 val = util.AsUint16(minEnd - whitePrefixLen)83 } else {84 val = util.AsUint16(math.MaxUint16 - math.MaxUint16*(maxEnd-whitePrefixLen)/int(item.TrimLength()+1))84 val = util.AsUint16(math.MaxUint16 - math.MaxUint16*(maxEnd-whitePrefixLen)/(int(item.TrimLength())+1))85 }86 }87 }88 result.points[3-idx] = val
175 unmodified lines