summaryrefslogtreecommitdiff
path: root/Seek.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 /Seek.hs
parent0a36f92a31196451c2d838fd0ae15527e8bbce18 (diff)
look up --to and --from remote names only once
This will speed up commands like move and drop.
Diffstat (limited to 'Seek.hs')
-rw-r--r--Seek.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/Seek.hs b/Seek.hs
index af074c7c5..53101b23e 100644
--- a/Seek.hs
+++ b/Seek.hs
@@ -91,9 +91,9 @@ withKeys a params = return $ map (a . parse) params
- a conversion function, and then is passed into the seek action.
- This ensures that the conversion function only runs once.
-}
-withField :: String -> (Maybe String -> a) -> (a -> CommandSeek) -> CommandSeek
+withField :: String -> (Maybe String -> Annex a) -> (a -> CommandSeek) -> CommandSeek
withField field converter a ps = do
- f <- converter <$> Annex.getField field
+ f <- converter =<< Annex.getField field
a f ps
withNothing :: CommandStart -> CommandSeek