diff options
author | Joey Hess <joey@kitenet.net> | 2011-12-15 18:11:42 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-12-15 18:19:36 -0400 |
commit | 95d2391f58ae240e7100f0d5488dd7246f71f3bb (patch) | |
tree | f33f21904ae7be4d40b70bab1e2a68fd4eef5526 /Command/Unused.hs | |
parent | b7e0d39abbc9a09c21c6f0103ad6c9f4547f81fe (diff) |
more partial function removal
Left a few Prelude.head's in where it was checked not null and too hard to
remove, etc.
Diffstat (limited to 'Command/Unused.hs')
-rw-r--r-- | Command/Unused.hs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Command/Unused.hs b/Command/Unused.hs index 8a70ff335..ef398b01e 100644 --- a/Command/Unused.hs +++ b/Command/Unused.hs @@ -154,13 +154,13 @@ excludeReferenced l = do (S.fromList l) where -- Skip the git-annex branches, and get all other unique refs. - refs = map (Git.Ref . last) . - nubBy cmpheads . + refs = map (Git.Ref . snd) . + nubBy uniqref . filter ourbranches . - map words . lines . L.unpack - cmpheads a b = head a == head b + map (separate (== ' ')) . lines . L.unpack + uniqref (a, _) (b, _) = a == b ourbranchend = '/' : show Annex.Branch.name - ourbranches ws = not $ ourbranchend `isSuffixOf` last ws + ourbranches (_, b) = not $ ourbranchend `isSuffixOf` b removewith [] s = return $ S.toList s removewith (a:as) s | s == S.empty = return [] -- optimisation |