diff options
author | James Crayne <jim.crayne@gmail.com> | 2018-05-30 01:54:16 +0000 |
---|---|---|
committer | James Crayne <jim.crayne@gmail.com> | 2018-05-30 01:54:16 +0000 |
commit | 28eae4262ae7c31d77f09a10020ec6a0005a207d (patch) | |
tree | 6f7c458ce62730e722eba8aa9973504fd12ff45a /src | |
parent | b61ab59005ed50aaa594adec21853a95a2e660b3 (diff) |
off by 1 bug
Diffstat (limited to 'src')
-rw-r--r-- | src/Data/Word64RangeMap.hs | 2 |
1 files changed, 1 insertions, 1 deletions
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 | |||
96 | ra <- readRefArray r | 96 | ra <- readRefArray r |
97 | (zr,nr) <- getBounds ra -- bounds of mutable range array | 97 | (zr,nr) <- getBounds ra -- bounds of mutable range array |
98 | let (dr,mr) = (nr+1 - zr) `divMod` 2 | 98 | let (dr,mr) = (nr+1 - zr) `divMod` 2 |
99 | lookupArrayHelper i r (zr+dr+mr) zr nr | 99 | lookupArrayHelper i r (zr+dr+mr-1) zr nr |
100 | 100 | ||
101 | lookupArrayHelper :: RangeArray ra m b ref => Index -> RangeMap ra b ref | 101 | lookupArrayHelper :: RangeArray ra m b ref => Index -> RangeMap ra b ref |
102 | -> OuterIndex{- current position -} | 102 | -> OuterIndex{- current position -} |