summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDon Stewart <dons@cse.unsw.edu.au>2007-04-30 04:45:25 +0200
committerDon Stewart <dons@cse.unsw.edu.au>2007-04-30 04:45:25 +0200
commit24965e48e5df8e0a83dfceb45fdae5bf04c4c758 (patch)
tree5a62aad1bb2856a6e5f7d7a62cad2e7720230502
parent240245e14604399f52a364377585d7520a41a540 (diff)
downloadmetatile-24965e48e5df8e0a83dfceb45fdae5bf04c4c758.tar
metatile-24965e48e5df8e0a83dfceb45fdae5bf04c4c758.zip
shrink 'rotate' a little
darcs-hash:20070430024525-9c5c1-fd54666b06e2d896e023e7ae1c8f2b32fdb7a815
-rw-r--r--StackSet.hs6
1 files changed, 2 insertions, 4 deletions
diff --git a/StackSet.hs b/StackSet.hs
index b052141..73c3bfb 100644
--- a/StackSet.hs
+++ b/StackSet.hs
@@ -143,10 +143,8 @@ rotate :: (Integral i, Eq a) => Ordering -> StackSet i j a -> StackSet i j a
rotate o w = maybe w id $ do
f <- M.lookup (current w) (focus w)
s <- M.lookup (current w) (stacks w)
- ea <- case o of
- EQ -> Nothing
- GT -> elemAfter f s
- LT -> elemAfter f (reverse s)
+ ea <- case o of EQ -> Nothing
+ _ -> elemAfter f (if o == GT then s else reverse s)
return $ w { focus = M.insert (current w) ea (focus w) }
-- | /O(log n)/. shift. move the client on top of the current stack to