Skip to content

Commit

Permalink
audit: handle case where the array is empty (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
JordyRo1 authored Nov 10, 2023
1 parent 6370090 commit d177284
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/operations/time_series/metrics.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ fn _sum_volatility(arr: Span<TickElem>) -> Fixed {
let mut cur_idx = 1;
let mut sum = FixedTrait::new(0, false);
loop {
if (cur_idx == arr.len()) {
if (cur_idx >= arr.len()) {
break ();
}
let cur_val = *arr.at(cur_idx);
Expand Down

0 comments on commit d177284

Please sign in to comment.