Skip to content
Myr

Replace nested max calls with single max

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

authored by Marcel Meyer · committed by Junegunn Choi · parent 6eb4b41 · Browse files · 1 file+3 added−3 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+3 added−3 removed

  • other:+3 added−3 removed

1 file+3 added−3 removed

modified:src/algo/algo.go+3 added-3 removed
587 unmodified lines
588 // Break consecutive chunk589 if b >= bonusBoundary && b > fb {590 consecutive = 1591 } else {592 b = max(b, max(bonusConsecutive, fb))592 b = max(b, bonusConsecutive, fb)593 }594 }595 if s1+b < s2 {596 s1 += Bsub[off]
4 unmodified lines
601 }602 Csub[off] = consecutive603604 inGap = s1 < s2605 score := max(max(s1, s2), 0)605 score := max(s1, s2, 0)606 if pidx == M-1 && (forward && score > maxScore || !forward && score >= maxScore) {607 maxScore, maxScorePos = score, col608 }609 Hsub[off] = score
75 unmodified lines
685 // Break consecutive chunk686 if bonus >= bonusBoundary && bonus > firstBonus {687 firstBonus = bonus688 }689 bonus = max(max(bonus, firstBonus), bonusConsecutive)689 bonus = max(bonus, firstBonus, bonusConsecutive)690 }691 if pidx == 0 {692 score += int(bonus * bonusFirstCharMultiplier)693 } else {
341 unmodified lines