diff --git a/src/Renderer/TOC.hs b/src/Renderer/TOC.hs index 229023761..8f7afc109 100644 --- a/src/Renderer/TOC.hs +++ b/src/Renderer/TOC.hs @@ -105,7 +105,7 @@ diffTOC blobs diff = removeDupes (diffToTOCSummaries (source <$> blobs) diff) >> toTOCSummaries patch = case afterOrBefore patch of ErrorInfo{..} -> pure $ TOCSummary patch Nothing - BranchInfo{..} -> flattenPatch (toLeafInfos <$> patch) >>= toTOCSummaries + BranchInfo{..} -> traverse toLeafInfos patch >>= toTOCSummaries LeafInfo{..} -> pure . TOCSummary patch $ case leafCategory of C.Function -> Just $ Summarizable leafCategory termName leafSourceSpan (patchType patch) C.Method -> Just $ Summarizable leafCategory termName leafSourceSpan (patchType patch) @@ -122,12 +122,6 @@ diffTOC blobs diff = removeDupes (diffToTOCSummaries (source <$> blobs) diff) >> isSummarizable S.Function{} = True isSummarizable _ = False -flattenPatch :: Patch [a] -> [Patch a] -flattenPatch patch = case patch of - Replace i1 i2 -> zipWith Replace i1 i2 - Insert info -> Insert <$> info - Delete info -> Delete <$> info - toLeafInfos :: DiffInfo -> [DiffInfo] toLeafInfos BranchInfo{..} = branches >>= toLeafInfos toLeafInfos leaf = [leaf]