1
1
mirror of https://github.com/github/semantic.git synced 2024-12-22 06:11:49 +03:00

Simplify toJSONSummaries.

This commit is contained in:
Rob Rix 2017-05-08 17:16:48 -04:00
parent 28d858ce32
commit c369867230

View File

@ -129,9 +129,7 @@ diffTOC blobs diff = removeDupes (diffToTOCSummaries (source <$> blobs) diff) >>
isSummarizable _ = False isSummarizable _ = False
toJSONSummaries :: TOCSummary DiffInfo -> [JSONSummary] toJSONSummaries :: TOCSummary DiffInfo -> [JSONSummary]
toJSONSummaries TOCSummary{..} = toJSONSummaries' (afterOrBefore summaryPatch) toJSONSummaries TOCSummary{..} = case afterOrBefore summaryPatch of
where
toJSONSummaries' diffInfo = case diffInfo of
ErrorInfo{..} -> [ErrorSummary termName infoSpan] ErrorInfo{..} -> [ErrorSummary termName infoSpan]
LeafInfo{..} -> maybe [] (pure . JSONSummary) parentInfo LeafInfo{..} -> maybe [] (pure . JSONSummary) parentInfo