1
1
mirror of https://github.com/github/semantic.git synced 2024-11-24 00:42:33 +03:00

Evaluate endpoints eagerly.

This commit is contained in:
Rob Rix 2017-06-21 16:07:42 -04:00
parent d822c138b3
commit a084544487

View File

@ -28,7 +28,7 @@ ses eq as' bs'
-- Search an edit graph for the shortest edit script up to a given proposed edit distance, building on the results of previous searches.
searchUpToD !d !v =
let endpoints = slideFrom . searchAlongK <$> [ k | k <- [-d, -d + 2 .. d], inRange (-m, n) k ] in
let !endpoints = slideFrom . searchAlongK <$> [ k | k <- [-d, -d + 2 .. d], inRange (-m, n) k ] in
case find isComplete endpoints of
Just (Endpoint _ _ script) -> script
_ -> searchUpToD (succ d) (Array.array (-d, d) ((\ e@(Endpoint x y _) -> (x - y, e)) <$> endpoints))