summaryrefslogtreecommitdiff
path: root/Command/Unused.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-09-29 23:43:42 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-09-29 23:48:57 -0400
commit7ff89ccfee13dcfe89cbdef83454e880dabd7186 (patch)
tree953858f36ccd021832d286c6a5915e44a05081ce /Command/Unused.hs
parent949ef94d5e5583e55d6ba9797cf71177b252173d (diff)
convert all git read/write functions to use ByteStrings
This yields a second or so speedup in unused, find, etc. Seems that even when the ByteString is immediately split and then converted to Strings, it's faster. I may try to push ByteStrings out into more of git-annex gradually, although I suspect most of the time-critical parts are already covered now, and many of the rest rely on libraries that only support Strings.
Diffstat (limited to 'Command/Unused.hs')
-rw-r--r--Command/Unused.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/Command/Unused.hs b/Command/Unused.hs
index 0c1ffe603..987f36720 100644
--- a/Command/Unused.hs
+++ b/Command/Unused.hs
@@ -16,6 +16,7 @@ import Data.Maybe
import System.FilePath
import System.Directory
import Data.List
+import qualified Data.ByteString.Lazy.Char8 as L
import Command
import Types
@@ -172,7 +173,7 @@ excludeReferenced l = do
refs = map last .
nubBy cmpheads .
filter ourbranches .
- map words . lines
+ map words . lines . L.unpack
cmpheads a b = head a == head b
ourbranchend = '/' : Branch.name
ourbranches ws = not $ ourbranchend `isSuffixOf` last ws