1
1
mirror of https://github.com/github/semantic.git synced 2025-01-06 06:46:07 +03:00

Use or to test for changes.

This commit is contained in:
Rob Rix 2015-12-22 17:57:16 -05:00
parent b25da81f81
commit 946b1067b3

View File

@ -45,11 +45,11 @@ split diff before after = return . renderHtml
columnWidth = max (20 + digits maxNumber * 8) 40
numberedLinesToMarkup :: (Int, Line (SplitDiff a Info), Int, Line (SplitDiff a Info)) -> Markup
numberedLinesToMarkup (m, left, n, right) = tr $ toMarkup (foldl (||) False $ hasChanges <$> unLine left, m, renderable before left) <> toMarkup (foldl (||) False $ hasChanges <$> unLine right, n, renderable after right) <> string "\n"
numberedLinesToMarkup (m, left, n, right) = tr $ toMarkup (or $ hasChanges <$> unLine left, m, renderable before left) <> toMarkup (or $ hasChanges <$> unLine right, n, renderable after right) <> string "\n"
renderable source = fmap (Renderable . (,) source)
hasChanges diff = foldl (||) False $ const True <$> diff
hasChanges diff = or $ const True <$> diff
numberRows :: [(Int, Line a, Int, Line a)] -> Row a -> [(Int, Line a, Int, Line a)]
numberRows [] (Row EmptyLine EmptyLine) = []