mirror of
https://github.com/github/semantic.git
synced 2024-12-22 14:21:31 +03:00
Take an Int instead of a Diagonal.
This commit is contained in:
parent
9ab575b264
commit
ad217cda68
@ -68,10 +68,10 @@ getK :: Direction -> Diagonal -> Myers Endpoint
|
|||||||
getK direction (Diagonal diagonal) = do
|
getK direction (Diagonal diagonal) = do
|
||||||
MyersState forward backward (Diagonal offset) <- get
|
MyersState forward backward (Diagonal offset) <- get
|
||||||
let v = case direction of { Forward -> forward ; Reverse -> backward }
|
let v = case direction of { Forward -> forward ; Reverse -> backward }
|
||||||
return $! v `at` Diagonal (offset + diagonal)
|
return $! v `at` (offset + diagonal)
|
||||||
|
|
||||||
at :: Vector.Vector Int -> Diagonal -> Endpoint
|
at :: Vector.Vector Int -> Int -> Endpoint
|
||||||
at v (Diagonal k) = Endpoint (v Vector.! k) 0
|
at v k = Endpoint (v Vector.! k) 0
|
||||||
|
|
||||||
overlaps :: Endpoint -> Endpoint -> Bool
|
overlaps :: Endpoint -> Endpoint -> Bool
|
||||||
overlaps (Endpoint x y) (Endpoint u v) = x - y == u - v && x <= u
|
overlaps (Endpoint x y) (Endpoint u v) = x - y == u - v && x <= u
|
||||||
|
Loading…
Reference in New Issue
Block a user