mirror of
https://github.com/github/semantic.git
synced 2024-11-29 11:02:26 +03:00
🔥 offsetRange.
This commit is contained in:
parent
7bb8fe4aaf
commit
775f6a131c
@ -3,7 +3,6 @@ module Data.Range
|
||||
( Range(..)
|
||||
, emptyRange
|
||||
, rangeLength
|
||||
, offsetRange
|
||||
, intersectsRange
|
||||
, subtractRange
|
||||
) where
|
||||
@ -24,10 +23,6 @@ emptyRange = Range 0 0
|
||||
rangeLength :: Range -> Int
|
||||
rangeLength range = end range - start range
|
||||
|
||||
-- | Offset a range by a constant delta.
|
||||
offsetRange :: Range -> Int -> Range
|
||||
offsetRange a b = Range (start a + b) (end a + b)
|
||||
|
||||
-- | Test two ranges for intersection.
|
||||
intersectsRange :: Range -> Range -> Bool
|
||||
intersectsRange range1 range2 = start range1 < end range2 && start range2 < end range1
|
||||
|
Loading…
Reference in New Issue
Block a user