From e369dbec3608588f901978ca34a8f1b528ab6c81 Mon Sep 17 00:00:00 2001 From: David Himmelstrup Date: Tue, 8 Sep 2020 19:09:03 +0800 Subject: [PATCH] Disable hashing for now. --- src/Reanimate/Render.hs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/Reanimate/Render.hs b/src/Reanimate/Render.hs index 7142e5d..0e26961 100644 --- a/src/Reanimate/Render.hs +++ b/src/Reanimate/Render.hs @@ -64,20 +64,15 @@ renderSvgs :: FilePath -> Int -> Bool -> Animation -> IO () renderSvgs folder offset _prettyPrint ani = do print frameCount lock <- newMVar () - hashedFrames <- newMVar M.empty handle errHandler $ concurrentForM_ (frameOrder rate frameCount) $ \nth' -> do let nth = (nth'+offset) `mod` frameCount now = (duration ani / (fromIntegral frameCount - 1)) * fromIntegral nth frame = frameAt (if frameCount <= 1 then 0 else now) ani path = folder show nth <.> "svg" - cachedFrame <- M.lookup frame <$> readMVar hashedFrames + ~svg = renderSvg Nothing Nothing frame + idempotentFile path $ - case cachedFrame of - Nothing -> do - let svg = renderSvg Nothing Nothing frame - writeFile path svg - modifyMVar_ hashedFrames $ \hm -> pure $ M.insert frame path hm - Just frameFile -> copyFile frameFile path + writeFile path svg withMVar lock $ \_ -> do print nth hFlush stdout