mirror of
https://github.com/girlbossceo/conduwuit.git
synced 2025-12-14 11:18:58 -05:00
correct arithmetic adjustments
Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
parent
16a98b0683
commit
321e197d8c
12 changed files with 24 additions and 53 deletions
|
|
@ -284,11 +284,7 @@ fn count_to_id(room_id: &RoomId, count: PduCount, offset: u64, subtract: bool) -
|
|||
pdu_id.extend_from_slice(&0_u64.to_be_bytes());
|
||||
let num = u64::MAX.saturating_sub(x);
|
||||
if subtract {
|
||||
if num > 0 {
|
||||
num.saturating_sub(offset)
|
||||
} else {
|
||||
num
|
||||
}
|
||||
num.saturating_sub(offset)
|
||||
} else {
|
||||
num.saturating_add(offset)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue