1
1
mirror of https://github.com/github/semantic.git synced 2024-12-23 06:41:45 +03:00

Don’t iterate each line of each child.

This commit is contained in:
Rob Rix 2016-03-24 11:32:41 -04:00
parent 6087ce0560
commit 0a1b3508ee

View File

@ -134,8 +134,7 @@ groupChildrenByLine :: Join These [Range] -> [AlignedDiff leaf] -> [Join These (
groupChildrenByLine ranges children = go rangeLists children
where rangeLists = these (flip (,) []) ((,) []) (,) (runJoin ranges)
go ranges children | (l:ls, r:rs) <- ranges
, ((firstLine:restOfLines):rest) <- children = go ranges (restOfLines:rest)
| ([]:rest) <- children = go ranges rest
, (child:rest) <- children = go ranges rest
| otherwise = uncurry (alignWith (fmap (flip (,) []) . Join)) ranges
intersects :: Range -> Range -> Bool