Skip to content

Commit

Permalink
fix: use saturating substract in housekeeping logic
Browse files Browse the repository at this point in the history
  • Loading branch information
scarmuega committed Oct 13, 2024
1 parent baa7e0d commit 007b7dd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/wal/redb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,8 @@ impl WalStore {
}
};

let delta = last_slot - start_slot;
let excess = delta - max_slots;
let delta = last_slot.saturating_sub(start_slot);
let excess = delta.saturating_sub(max_slots);

debug!(
delta,
Expand Down

0 comments on commit 007b7dd

Please sign in to comment.