git.iko.soy/distributed-process
on master help sign in
small optimisation
3fa8671Simon Marlow
distributed-process/src/Control/Distributed/Process/Internal/CQueue.hs+2−3
@@ -229,9 +229,8 @@ dequeue (CQueue arrived incoming) blockSpec matchons =
229 go (Append xs ys) tl = go xs (append ys tl)
229 go (Append xs ys) tl = go xs (append ys tl)
230 go (Snoc xs x) tl = go xs (Cons x tl)
230 go (Snoc xs x) tl = go xs (Cons x tl)
231 go (Cons x xs) tl
231 go (Cons x xs) tl
232− | Just y <- checkMatches matches x = (Append xs tl, Just y)
232+ | Just y <- checkMatches matches x = (append xs tl, Just y)
233− | otherwise = (Cons x rest, r)
234− where !(rest,r) = go xs tl
233+ | otherwise = let !(rest,r) = go xs tl in (Cons x rest, r)
235
234
236 checkMatches :: [m -> Maybe a] -> m -> Maybe a
235 checkMatches :: [m -> Maybe a] -> m -> Maybe a
237 checkMatches [] _ = Nothing
236 checkMatches [] _ = Nothing