diff options
author | Joey Hess <joeyh@joeyh.name> | 2017-01-31 19:42:00 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2017-01-31 19:42:00 -0400 |
commit | 593d91f74c2bd7b9fa36e501afb5ed5d292c464e (patch) | |
tree | 38a828a14c461ecde0c0a5615be3accb98eb33ef /Git | |
parent | 7b1f48cbd5d78877ae3a6b6a5415a9bed6df79b2 (diff) |
unused: Improved memory use significantly when there are a lot of differences between branches.
Argh, didn't need an accumulator here!
I think I use accumulators a lot more than I need to when recusively
processing lists..
This commit was sponsored by Jeff Goeke-Smith on Patreon.
Diffstat (limited to 'Git')
-rw-r--r-- | Git/DiffTree.hs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Git/DiffTree.hs b/Git/DiffTree.hs index 309575aaf..dae99db41 100644 --- a/Git/DiffTree.hs +++ b/Git/DiffTree.hs @@ -101,11 +101,11 @@ getdiff command params repo = do {- Parses --raw output used by diff-tree and git-log. -} parseDiffRaw :: [String] -> [DiffTreeItem] -parseDiffRaw l = go l [] +parseDiffRaw l = go l where - go [] c = c - go (info:f:rest) c = go rest (mk info f : c) - go (s:[]) _ = error $ "diff-tree parse error near \"" ++ s ++ "\"" + go [] = [] + go (info:f:rest) = mk info f : go rest + go (s:[]) = error $ "diff-tree parse error near \"" ++ s ++ "\"" mk info f = DiffTreeItem { srcmode = readmode srcm |