on develop help sign in
Eliminate some unused stuff in SpiderTimeline
0ba584aRyan Trinkle
src/Reflex/Spider/Internal.hs+2−11
@@ -1641,9 +1641,6 @@ initHold (SomeHoldInit h) = void $ getHoldEventSubscription h
1641-- | Run an event action outside of a frame
1641-- | Run an event action outside of a frame
1642runFrame :: forall x a. EventM x a -> SpiderHost x a --TODO: This function also needs to hold the mutex
1642runFrame :: forall x a. EventM x a -> SpiderHost x a --TODO: This function also needs to hold the mutex
1643runFrame a = SpiderHost $ ask >>= \spiderTimeline -> lift $ do
1643runFrame a = SpiderHost $ ask >>= \spiderTimeline -> lift $ do
1644− -- Clear out pending unsubscriptions; these will need to happen eventually anyway, and might cause us a lot of extra work during the frame, so get rid of them now
1645− pendingCleanups <- atomicModifyIORef (_spiderTimeline_cleanups spiderTimeline) $ \x -> ([], x)
1646− {-# SCC "cleanups" #-} sequence_ pendingCleanups
1647 toAssignRef <- newIORef [] -- This should only actually get used when events are firing
1644 toAssignRef <- newIORef [] -- This should only actually get used when events are firing
1648 holdInitRef <- newIORef []
1645 holdInitRef <- newIORef []
1649 mergeUpdateRef <- newIORef []
1646 mergeUpdateRef <- newIORef []
@@ -1818,9 +1815,7 @@ globalSpiderTimeline = unsafePerformIO unsafeNewSpiderTimeline
1818-- | Stores all global data relevant to a particular Spider timeline; only one
1815-- | Stores all global data relevant to a particular Spider timeline; only one
1819-- value should exist for each type @x@
1816-- value should exist for each type @x@
1820data SpiderTimeline x = SpiderTimeline
1817data SpiderTimeline x = SpiderTimeline
1821− { _spiderTimeline_toUnsubscribe :: !(IORef [EventSubscription x])
1822− , _spiderTimeline_lock :: !(MVar ())
1818+ { _spiderTimeline_lock :: !(MVar ())
1823− , _spiderTimeline_cleanups :: !(IORef [IO ()])
1824#ifdef DEBUG
1819#ifdef DEBUG
1825 , _spiderTimeline_depth :: !(IORef Int)
1820 , _spiderTimeline_depth :: !(IORef Int)
1826#endif
1821#endif
@@ -1834,16 +1829,12 @@ instance GEq SpiderTimeline where
1834
1829
1835unsafeNewSpiderTimeline :: forall x. IO (SpiderTimeline x)
1830unsafeNewSpiderTimeline :: forall x. IO (SpiderTimeline x)
1836unsafeNewSpiderTimeline = do
1831unsafeNewSpiderTimeline = do
1837− toUnsubscribe <- newIORef []
1838 lock <- newMVar ()
1832 lock <- newMVar ()
1839− cleanups <- newIORef []
1840#ifdef DEBUG
1833#ifdef DEBUG
1841 depthRef <- newIORef 0
1834 depthRef <- newIORef 0
1842#endif
1835#endif
1843 return $ SpiderTimeline
1836 return $ SpiderTimeline
1844− { _spiderTimeline_toUnsubscribe = toUnsubscribe
1845− , _spiderTimeline_lock = lock
1837+ { _spiderTimeline_lock = lock
1846− , _spiderTimeline_cleanups = cleanups
1847#ifdef DEBUG
1838#ifdef DEBUG
1848 , _spiderTimeline_depth = depthRef
1839 , _spiderTimeline_depth = depthRef
1849#endif
1840#endif