def collect_best

bend-edit-distance@0.2.2.0 · src/DistanceDP.bend:113

import bend-edit-distance@0.2.2.0/src/DistanceDP.bend as DistanceDP
import Base
import bend-edit-distance@0.2.2.0/EdlibTypes.bend as E

113def collect_best(best: Best, score: U32, end: E.Coordinate, comparison: Cmp) -> Best:
114  match best comparison:
115    case _ LT{}:
116      Best{score, [end]}
117    case Best{old, ends} EQ{}:
118      Best{old, end <> ends}
119    case _ GT{}:
120      best

Uses (5)

Used by (1)