From 593d91f74c2bd7b9fa36e501afb5ed5d292c464e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 31 Jan 2017 19:42:00 -0400 Subject: 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. --- Git/DiffTree.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Git') 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 -- cgit v1.2.3