From 28eae4262ae7c31d77f09a10020ec6a0005a207d Mon Sep 17 00:00:00 2001 From: James Crayne Date: Wed, 30 May 2018 01:54:16 +0000 Subject: off by 1 bug --- src/Data/Word64RangeMap.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/Data/Word64RangeMap.hs b/src/Data/Word64RangeMap.hs index 36428233..0b25f56d 100644 --- a/src/Data/Word64RangeMap.hs +++ b/src/Data/Word64RangeMap.hs @@ -96,7 +96,7 @@ lookupArray i r = do ra <- readRefArray r (zr,nr) <- getBounds ra -- bounds of mutable range array let (dr,mr) = (nr+1 - zr) `divMod` 2 - lookupArrayHelper i r (zr+dr+mr) zr nr + lookupArrayHelper i r (zr+dr+mr-1) zr nr lookupArrayHelper :: RangeArray ra m b ref => Index -> RangeMap ra b ref -> OuterIndex{- current position -} -- cgit v1.2.3