summaryrefslogtreecommitdiff
path: root/Command/DropUnused.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-01-06 04:02:35 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-01-06 04:06:13 -0400
commitdf21cbfdd2b7342c206ebd4aea32d989328374dc (patch)
tree24f6624e4e4c6dc06b53735bfb52973366e7b159 /Command/DropUnused.hs
parent0a36f92a31196451c2d838fd0ae15527e8bbce18 (diff)
look up --to and --from remote names only once
This will speed up commands like move and drop.
Diffstat (limited to 'Command/DropUnused.hs')
-rw-r--r--Command/DropUnused.hs5
1 files changed, 2 insertions, 3 deletions
diff --git a/Command/DropUnused.hs b/Command/DropUnused.hs
index fd3e84fe5..1c5bf8b8c 100644
--- a/Command/DropUnused.hs
+++ b/Command/DropUnused.hs
@@ -51,10 +51,9 @@ start (unused, unusedbad, unusedtmp) s = search
next $ a key
perform :: Key -> CommandPerform
-perform key = maybe droplocal dropremote =<< Annex.getField "from"
+perform key = maybe droplocal dropremote =<< Remote.byName =<< Annex.getField "from"
where
- dropremote name = do
- r <- Remote.byName name
+ dropremote r = do
showAction $ "from " ++ Remote.name r
ok <- Remote.removeKey r key
next $ Command.Drop.cleanupRemote key r ok