diff options
author | Adam Vogt <vogt.adam@gmail.com> | 2009-11-29 04:26:50 +0100 |
---|---|---|
committer | Adam Vogt <vogt.adam@gmail.com> | 2009-11-29 04:26:50 +0100 |
commit | a1ac655c911f97c3a7bb455ad601426012eeb673 (patch) | |
tree | a7d83a5a5e52cfcb8bbbf2e1e09de4eecea4ae49 /XMonad | |
parent | 736744c0ff00d47b45fb0aa4a2dbf0622d7ec622 (diff) | |
download | XMonadContrib-a1ac655c911f97c3a7bb455ad601426012eeb673.tar.gz XMonadContrib-a1ac655c911f97c3a7bb455ad601426012eeb673.tar.xz XMonadContrib-a1ac655c911f97c3a7bb455ad601426012eeb673.zip |
Use lookup instead of find in A.PerWorkspaceKeys
Ignore-this: 7ecb043df4317365ff3d25b17303eed8
darcs-hash:20091129032650-1499c-73cf78ec246d6c088d01e8c0eeae32fa3978f3dc.gz
Diffstat (limited to 'XMonad')
-rw-r--r-- | XMonad/Actions/PerWorkspaceKeys.hs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/XMonad/Actions/PerWorkspaceKeys.hs b/XMonad/Actions/PerWorkspaceKeys.hs index dcf1a9b..20705e1 100644 --- a/XMonad/Actions/PerWorkspaceKeys.hs +++ b/XMonad/Actions/PerWorkspaceKeys.hs @@ -21,7 +21,6 @@ module XMonad.Actions.PerWorkspaceKeys ( import XMonad import XMonad.StackSet as S -import Data.List (find) -- $usage -- @@ -42,9 +41,9 @@ chooseAction f = withWindowSet (f . S.currentTag) -- If it isn't listed, then run default action (marked with empty string, \"\"), or do nothing if default isn't supplied. bindOn :: [(String, X())] -> X() bindOn bindings = chooseAction chooser where - chooser ws = case find ((ws==).fst) bindings of - Just (_, action) -> action - Nothing -> case find ((""==).fst) bindings of - Just (_, action) -> action + chooser ws = case lookup ws bindings of + Just action -> action + Nothing -> case lookup "" bindings of + Just action -> action Nothing -> return () |