1
1
mirror of https://github.com/github/semantic.git synced 2024-12-22 22:31:36 +03:00

Subtract length of the start of range2 to (max (end range1) (end range2))

This commit is contained in:
joshvera 2017-10-19 21:32:18 -04:00
parent bd1fc11726
commit 930d505128

View File

@ -29,7 +29,7 @@ intersectsRange :: Range -> Range -> Bool
intersectsRange range1 range2 = start range1 < end range2 && start range2 < end range1
subtractRange :: Range -> Range -> Range
subtractRange range1 range2 = Range (start range1) (end range1 - rangeLength range2)
subtractRange range1 range2 = Range (start range1) (end range1 - rangeLength (Range (start range2) (max (end range1) (end range2))))
-- Instances