1
1
mirror of https://github.com/github/semantic.git synced 2025-01-03 04:51:57 +03:00

Avoid a redundant O(n) traversal of each diff.

This commit is contained in:
Rob Rix 2017-05-26 14:57:08 -04:00
parent aaf3bb0632
commit 6ed7c37e5b

View File

@ -35,7 +35,7 @@ diffBlobPairs :: (Monoid output, StringConv output ByteString, HasField fields C
diffBlobPairs decorator renderer blobs = do
diffs <- Async.mapConcurrently go blobs
let diffs' = diffs >>= \ (blobs, diff) -> (,) blobs <$> toList diff
renderConcurrently (pure . runRenderer renderer) (diffs' `using` parTraversable (parTuple2 r0 rdeepseq))
renderConcurrently (pure . runRenderer renderer) diffs'
where
go blobPair = do
diff <- diffBlobPair decorator blobPair