packages feed

apecs 0.8.1 → 0.8.2

raw patch · 4 files changed

+10/−7 lines, 4 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -1,3 +1,7 @@+## [0.8.2]+### Changed+- (#55) Fixed a bug where components where not properly deleted from the cache following the cache bitmasking update+ ## [0.8.1] ### Changed - Changed `Cache`s to use bitmasks instead of the remainder operation. This makes caches up to three times faster.
apecs.cabal view
@@ -1,5 +1,5 @@ name:                apecs-version:             0.8.1+version:             0.8.2 homepage:            https://github.com/jonascarpay/apecs#readme license:             BSD3 license-file:        LICENSE
src/Apecs/Components.hs view
@@ -46,7 +46,7 @@  T.makeInstances [2..8] --- | Psuedocomponent indicating the absence of @a@.+-- | Pseudocomponent indicating the absence of @a@. --   Mainly used as e.g. @cmap $ \(a, Not b) -> c@ to iterate over entities with an @a@ but no @b@. --   Can also be used to delete components, like @cmap $ \a -> (Not :: Not a)@ to delete every @a@ component. data Not a = Not
src/Apecs/Stores.hs view
@@ -176,11 +176,10 @@   explDestroy (Cache mask tags cache s) ety = do     let index = ety .&. mask     tag <- liftIO$ UM.unsafeRead tags (ety .&. mask)-    if tag == ety-       then do-         liftIO$ UM.unsafeWrite tags  index (-2)-         liftIO$ VM.unsafeWrite cache index cacheMiss-       else explDestroy s ety+    when (tag == ety) $ liftIO $ do+      UM.unsafeWrite tags  index (-2)+      VM.unsafeWrite cache index cacheMiss+    explDestroy s ety  instance (MonadIO m, ExplMembers m s) => ExplMembers m (Cache n s) where   {-# INLINE explMembers #-}