Reduce a bit of recently introduced duplication in L.SubLayouts

This commit is contained in:
Adam Vogt 2009-07-05 17:51:45 +00:00
parent f8a4dd9503
commit f0c0f4d5c3

View File

@ -352,12 +352,10 @@ instance (Read (l Window), Show (l Window), LayoutClass l Window) => LayoutModif
in fgs $ M.unions $ map mkSingleton ws
| Just (Merge x y) <- fromMessage m
, let findGrp z = mplus (M.lookup z gs) $ listToMaybe
$ M.elems $ M.filter ((z `elem`) . W.integrate) gs
, Just (W.Stack _ xb xn) <- findGrp x
, Just yst <- findGrp y =
, Just (W.Stack _ xb xn) <- findGroup x
, Just yst <- findGroup y =
let zs = W.Stack x xb (xn ++ W.integrate yst)
in fgs $ M.update (\_ -> Just zs) x $ M.delete y gs
in fgs $ M.insert x zs $ M.delete (W.focus yst) gs
| Just (UnMerge x) <- fromMessage m =
fgs . M.fromList . map (W.focus &&& id) . M.elems