Skip to content

Commit

Permalink
helper
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchellwrosen committed Oct 9, 2023
1 parent 401325f commit 98da2a9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/TimerWheel/Internal/Bucket.hs
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,14 @@ insert i p x bucket =
Bin j q y m l r
| betteri ->
if
| prefixNotEqual m i j -> linki j bucket Nil
| outsider -> linki j bucket Nil
| goleft j m -> bini (insertj l) r
| otherwise -> bini l (insertj r)
| prefixNotEqual m i j -> linkj i (Tip i p x) (merge m l r)
| outsider -> linkj i (Tip i p x) (merge m l r)
| goleft i m -> binj (inserti l) r
| otherwise -> binj l (inserti r)
where
outsider = prefixNotEqual m i j
betteri = (p, i) < (q, j)
bini = Bin i p x m
binj = Bin j q y m
Expand Down

0 comments on commit 98da2a9

Please sign in to comment.