Skip to content

Commit

Permalink
Revert part of 33cafcc
Browse files Browse the repository at this point in the history
  • Loading branch information
eyeinsky committed Sep 22, 2022
1 parent 3d0de34 commit 04591ea
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions rewindable-index/src/RewindableIndex/Index/VSplit.hs
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,13 @@ insert e ix = do
c = ix ^. storage . cursor
vs = VGM.length es
VGM.unsafeWrite es c e
ns <- (ix ^. onInsert) ix e
let ix' = storage %~ updateSizes $
(storage . cursor) %~ (\c' -> (c' + 1) `rem` vs) $ ix
res <- if isStorageFull (ix' ^. storage)
then storeEvents ix'
else pure ix'
(ix ^. onInsert) ix e
return res
(storage . cursor) %~ (\c' -> (c' + 1) `rem` vs) $
notifications %~ (ns++) $ ix
if isStorageFull (ix' ^. storage)
then storeEvents ix'
else pure ix'

where
updateSizes :: Storage v m e -> Storage v m e
Expand Down

0 comments on commit 04591ea

Please sign in to comment.