Skip to content

Commit

Permalink
refactor(journal): remove use of slice
Browse files Browse the repository at this point in the history
  • Loading branch information
symbiont-stevan-andjelkovic committed Feb 14, 2022
1 parent 412a9b7 commit f5fa91b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/journal/test/JournalTest.hs
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,13 @@ appendBSFake bs fj@(FakeJournal bss ix termCount) =
readBytes :: Int
readBytes = Vector.sum
. Vector.map (\bs -> align (hEADER_LENGTH + BS.length bs) fRAME_ALIGNMENT)
. Vector.slice 0 (max 0 (ix - 1))
. Vector.take (ix - 1)
$ bss

unreadBytes :: Int
unreadBytes = Vector.sum
. Vector.map (\bs -> align (hEADER_LENGTH + BS.length bs) fRAME_ALIGNMENT)
. Vector.slice ix (max 0 (Vector.length bss - 1 - ix))
. Vector.drop ix
$ bss

readJournalFake :: FakeJournal -> (FakeJournal, Maybe ByteString)
Expand Down

0 comments on commit f5fa91b

Please sign in to comment.