no need to empty already empty MVars

This commit is contained in:
nek0 2020-08-29 07:22:26 +02:00
parent 9cd2ca9298
commit 8f5ea5531c
1 changed files with 0 additions and 2 deletions

View File

@ -166,12 +166,10 @@ sceneSwitch curScene evs = mapM_ (switch . SDL.eventPayload) evs
SDL.KeycodeF1 -> do
isEmpty <- isEmptyMVar curScene
when isEmpty $ do
void $ tryTakeMVar curScene
putMVar curScene =<< fmap Scene (initScene @ClearColor)
SDL.KeycodeF2 -> do
isEmpty <- isEmptyMVar curScene
when isEmpty $ do
void $ tryTakeMVar curScene
putMVar curScene =<< fmap Scene (initScene @Texture2D)
_ ->
return ()