diff options
author | 2014-01-05 21:30:48 -0400 | |
---|---|---|
committer | 2014-01-05 21:30:48 -0400 | |
commit | 4cf6d95c1a9d10cb59669eaceafce4c7a3155eb6 (patch) | |
tree | 2ed9440dd31cb4cb925e9010bd54694b8c776519 /Assistant/Alert.hs | |
parent | 5d305f1337e88ae7a07f54adc06c4a9d1d39f872 (diff) |
assistant: Fixed several minor memory leaks that manifested when adding a large number of files.
Diffstat (limited to 'Assistant/Alert.hs')
-rw-r--r-- | Assistant/Alert.hs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Assistant/Alert.hs b/Assistant/Alert.hs index c767d429d..055e66de5 100644 --- a/Assistant/Alert.hs +++ b/Assistant/Alert.hs @@ -5,7 +5,7 @@ - Licensed under the GNU GPL version 3 or higher. -} -{-# LANGUAGE OverloadedStrings, CPP #-} +{-# LANGUAGE OverloadedStrings, CPP, BangPatterns #-} module Assistant.Alert where @@ -367,8 +367,8 @@ fileAlert msg files = (activityAlert Nothing shortfiles) where maxfilesshown = 10 - (somefiles, counter) = splitcounter (dedupadjacent files) - shortfiles = map (fromString . shortFile . takeFileName) somefiles + (!somefiles, !counter) = splitcounter (dedupadjacent files) + !shortfiles = map (fromString . shortFile . takeFileName) somefiles renderer alert = tenseWords $ msg : alertData alert ++ showcounter where @@ -391,9 +391,9 @@ fileAlert msg files = (activityAlert Nothing shortfiles) in (keep, length rest) combiner new old = - let (fs, n) = splitcounter $ + let (!fs, n) = splitcounter $ dedupadjacent $ alertData new ++ alertData old - cnt = n + alertCounter new + alertCounter old + !cnt = n + alertCounter new + alertCounter old in old { alertData = fs , alertCounter = cnt |