1
1
mirror of https://github.com/github/semantic.git synced 2024-11-28 01:47:01 +03:00

Don’t re-get the state to modify it.

This commit is contained in:
Rob Rix 2017-06-13 17:58:15 -04:00
parent 46ffff3454
commit 2cd1816aa7

View File

@ -102,7 +102,7 @@ runSES eq (EditGraph as bs)
-- The upper/right extent of the search region or edit graph, whichever is smaller. -- The upper/right extent of the search region or edit graph, whichever is smaller.
moveRightFrom <$> getK v (Diagonal (pred k)) moveRightFrom <$> getK v (Diagonal (pred k))
endpoint <- slideFrom from endpoint <- slideFrom from
setK (Diagonal k) endpoint setK v (Diagonal k) endpoint
return endpoint return endpoint
-- | Move downward from a given vertex, inserting the element for the corresponding row. -- | Move downward from a given vertex, inserting the element for the corresponding row.
@ -116,8 +116,8 @@ runSES eq (EditGraph as bs)
let (x, script) = v ! k in return (Endpoint x (x - unDiagonal k) script) let (x, script) = v ! k in return (Endpoint x (x - unDiagonal k) script)
-- | Update the maximum extent reached and path taken along a given diagonal. -- | Update the maximum extent reached and path taken along a given diagonal.
setK k (Endpoint x _ script) = setK v k (Endpoint x _ script) =
modify (MyersState . (Array.// [(k, (x, script))]) . unMyersState) put (MyersState (v Array.// [(k, (x, script))]))
-- | Slide down any diagonal edges from a given vertex. -- | Slide down any diagonal edges from a given vertex.
slideFrom (Endpoint x y script) slideFrom (Endpoint x y script)