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.
This commit is contained in:
parent
062286135c
commit
ed60f60e9b
4 changed files with 19 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue