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

Use the inRange method to bounds check x/y.

This commit is contained in:
Rob Rix 2017-06-21 11:28:57 -04:00
parent 158b6387a3
commit e505b532a9

View File

@ -65,9 +65,7 @@ ses eq as' bs'
-- | Slide down any diagonal edges from a given vertex.
slideFrom (Endpoint x y script)
| x >= 0, x < n
, y >= 0, y < m
, a <- as ! x
, b <- bs ! y
| inRange (Array.bounds as) x, a <- as ! x
, inRange (Array.bounds bs) y, b <- bs ! y
, a `eq` b = slideFrom (Endpoint (succ x) (succ y) (These a b : script))
| otherwise = Endpoint x y script