mirror of
https://github.com/github/semantic.git
synced 2024-12-23 06:41:45 +03:00
Replace rangeLists with a use of fromThese.
This commit is contained in:
parent
4d99c94bc2
commit
6a0302acbf
@ -131,9 +131,8 @@ alignDiff sources diff = iter alignSyntax (alignPatch sources <$> diff)
|
||||
where lineRanges = runBothWith ((Join .) . These) (actualLineRanges <$> (characterRange <$> infos) <*> sources)
|
||||
|
||||
groupChildrenByLine :: Join These [Range] -> [AlignedDiff leaf] -> [Join These (Range, [SplitDiff leaf Info])]
|
||||
groupChildrenByLine ranges children = go rangeLists children
|
||||
where rangeLists = these (flip (,) []) ((,) []) (,) (runJoin ranges)
|
||||
go ranges children | (l:ls, r:rs) <- ranges
|
||||
groupChildrenByLine ranges children = go (fromThese [] [] $ runJoin ranges) children
|
||||
where go ranges children | (l:ls, r:rs) <- ranges
|
||||
, (child:rest) <- children
|
||||
= go ranges rest
|
||||
| otherwise = uncurry (alignWith (fmap (flip (,) []) . Join)) ranges
|
||||
|
Loading…
Reference in New Issue
Block a user