Skip to content
Browse files

Remove duplicate rendering logic in 'rendertoList'

  • Loading branch information...
1 parent 740f280 commit 2d34a54ea509c9a198028016e44673f12aebf31f @haasn haasn committed with Brent Yorgey
Showing with 1 addition and 5 deletions.
  1. +1 −5 src/Diagrams/Backend/Cairo/List.hs
View
6 src/Diagrams/Backend/Cairo/List.hs
@@ -17,11 +17,7 @@ import Foreign.Marshal.Array (peekArray)
renderToList :: (Ord a, Floating a) =>
Int -> Int -> Diagram Cairo R2 -> IO [[Colour a]]
-renderToList w h d = do
- b <- renderPtr w h d
- l <- peekArray (w*h*4) b
- free b
- return l
+renderToList w h d =
f 0 <$> bracket (renderPtr w h d) free (peekArray $ w*h*4)
where
f :: (Ord a, Floating a) => Int -> [Word8] -> [[Colour a]]

0 comments on commit 2d34a54

Please sign in to comment.
Something went wrong with that request. Please try again.