Skip to content

Commit

Permalink
Fix potential overflow issue (#521)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xh3rman authored Nov 19, 2024
1 parent 8887076 commit 4427688
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rust-sdk/core/src/math/tick_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ impl<const SIZE: usize> TickArraySequence<SIZE> {
for i in 0..tick_arrays.len() - 1 {
let current_start_tick_index = start_tick_index(&tick_arrays[i]);
let next_start_tick_index = start_tick_index(&tick_arrays[i + 1]);
if next_start_tick_index - current_start_tick_index != required_tick_array_spacing
&& next_start_tick_index != <i32>::MAX
if next_start_tick_index != <i32>::MAX
&& next_start_tick_index - current_start_tick_index != required_tick_array_spacing
{
return Err(TICK_ARRAY_NOT_EVENLY_SPACED);
}
Expand Down

0 comments on commit 4427688

Please sign in to comment.