From 3688556416bb02c278802e0b988058a102bd1b3a Mon Sep 17 00:00:00 2001 From: Joe Crayne Date: Thu, 30 May 2019 11:27:48 -0400 Subject: Avoid passing an empty range to OpenGL DrawArrays. --- RingBuffer.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RingBuffer.hs b/RingBuffer.hs index dd8a7f7..6ce36bc 100644 --- a/RingBuffer.hs +++ b/RingBuffer.hs @@ -45,8 +45,8 @@ ringMask r = do mask cnt | cnt==size = [(0,cnt)] | otherwise = case cnt + back - size of - front | front > cnt -> [(front - cnt,size)] - | otherwise -> [(0,back), (front,cnt - front)] + front | front >= cnt -> [(front - cnt,size)] + | otherwise -> [(0,back), (front,cnt - front)] return mask syncRing :: RingBuffer u -> IO () -- cgit v1.2.3