mirror of
https://github.com/github/semantic.git
synced 2024-12-22 06:11:49 +03:00
Factor the application of toLeafInfos out.
This commit is contained in:
parent
c3f510f83d
commit
f820af4f5a
@ -113,10 +113,10 @@ toTOCSummaries patch = case afterOrBefore patch of
|
||||
_ -> NotSummarizable
|
||||
|
||||
flattenPatch :: Patch DiffInfo -> [Patch DiffInfo]
|
||||
flattenPatch patch = case patch of
|
||||
Replace i1 i2 -> zipWith Replace (toLeafInfos i1) (toLeafInfos i2)
|
||||
Insert info -> Insert <$> toLeafInfos info
|
||||
Delete info -> Delete <$> toLeafInfos info
|
||||
flattenPatch patch = case toLeafInfos <$> patch of
|
||||
Replace i1 i2 -> zipWith Replace i1 i2
|
||||
Insert info -> Insert <$> info
|
||||
Delete info -> Delete <$> info
|
||||
|
||||
toLeafInfos :: DiffInfo -> [DiffInfo]
|
||||
toLeafInfos BranchInfo{..} = branches >>= toLeafInfos
|
||||
|
Loading…
Reference in New Issue
Block a user