Skip to content

Commit 4427688

Browse files
authored
Fix potential overflow issue (#521)
1 parent 8887076 commit 4427688

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

rust-sdk/core/src/math/tick_array.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ impl<const SIZE: usize> TickArraySequence<SIZE> {
3030
for i in 0..tick_arrays.len() - 1 {
3131
let current_start_tick_index = start_tick_index(&tick_arrays[i]);
3232
let next_start_tick_index = start_tick_index(&tick_arrays[i + 1]);
33-
if next_start_tick_index - current_start_tick_index != required_tick_array_spacing
34-
&& next_start_tick_index != <i32>::MAX
33+
if next_start_tick_index != <i32>::MAX
34+
&& next_start_tick_index - current_start_tick_index != required_tick_array_spacing
3535
{
3636
return Err(TICK_ARRAY_NOT_EVENLY_SPACED);
3737
}

0 commit comments

Comments
 (0)