diff options
author | Joey Hess <joey@kitenet.net> | 2012-08-26 14:45:47 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-08-26 14:45:47 -0400 |
commit | c58d5532651f78e8bf0266b818d5480d282b26e6 (patch) | |
tree | da4f480d13b06aaf51416dc02128492705960741 /Command/Sync.hs | |
parent | f4ca592cd0ac4940645f2f17fadac5e0da45424d (diff) |
refactor
Diffstat (limited to 'Command/Sync.hs')
-rw-r--r-- | Command/Sync.hs | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/Command/Sync.hs b/Command/Sync.hs index 986dd417b..2a27bf870 100644 --- a/Command/Sync.hs +++ b/Command/Sync.hs @@ -27,7 +27,6 @@ import qualified Types.Remote import qualified Remote.Git import Types.Key -import qualified Data.Map as M import qualified Data.ByteString.Lazy as L import Data.Hash.MD5 @@ -62,7 +61,7 @@ syncRemotes rs = ifM (Annex.getState Annex.fast) ( nub <$> pickfast , wanted ) where pickfast = (++) <$> listed <*> (good =<< fastest <$> available) wanted - | null rs = good =<< concat . byspeed <$> available + | null rs = good =<< concat . Remote.byCost <$> available | otherwise = listed listed = do l <- catMaybes <$> mapM (Remote.byName . Just) rs @@ -74,10 +73,7 @@ syncRemotes rs = ifM (Annex.getState Annex.fast) ( nub <$> pickfast , wanted ) available = filter (not . Remote.specialRemote) <$> Remote.enabledRemoteList good = filterM $ Remote.Git.repoAvail . Types.Remote.repo - fastest = fromMaybe [] . headMaybe . byspeed - byspeed = map snd . sort . M.toList . costmap - costmap = M.fromListWith (++) . map costpair - costpair r = (Types.Remote.cost r, [r]) + fastest = fromMaybe [] . headMaybe . Remote.byCost commit :: CommandStart commit = do |