mirror of
https://github.com/xmonad/xmonad.git
synced 2025-08-06 15:11:53 -07:00
shift: use guards instead of if
This commit is contained in:
@@ -474,7 +474,7 @@ swapMaster = modify' $ \c -> case c of
|
|||||||
-- element on the current stack, the original stackSet is returned.
|
-- element on the current stack, the original stackSet is returned.
|
||||||
--
|
--
|
||||||
shift :: (Ord a, Eq s, Eq i) => i -> StackSet i a s sd -> StackSet i a s sd
|
shift :: (Ord a, Eq s, Eq i) => i -> StackSet i a s sd -> StackSet i a s sd
|
||||||
shift n s = if n `tagMember` s && n /= curtag
|
shift n s | n `tagMember` s && n /= curtag = maybe s go (peek s)
|
||||||
then maybe s go (peek s) else s
|
| otherwise = s
|
||||||
where go w = view curtag . insertUp w . view n . delete w $ s
|
where go w = view curtag . insertUp w . view n . delete w $ s
|
||||||
curtag = tag (workspace (current s))
|
curtag = tag (workspace (current s))
|
||||||
|
Reference in New Issue
Block a user