Skip to content

Commit

Permalink
fix a bug with empty multidim arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
kaikalii committed Nov 14, 2023
1 parent 7576c67 commit f19ec8b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/algorithm/pervade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,9 @@ fn bin_pervade_recursive_mut<T>(
}
}
(ash, bsh) => {
if ash[0] == 0 || bsh[0] == 0 {
return;
}
let a_row_len = a_data.len() / ash[0];
let b_row_len = b_data.len() / bsh[0];
for (a, b) in a_data
Expand Down Expand Up @@ -342,6 +345,9 @@ fn bin_pervade_recursive_mut_left<T>(
}
}
(ash, bsh) => {
if ash[0] == 0 || bsh[0] == 0 {
return;
}
let a_row_len = a_data.len() / ash[0];
let b_row_len = b_data.len() / bsh[0];
for (a, b) in a_data
Expand Down Expand Up @@ -374,6 +380,9 @@ fn bin_pervade_recursive_mut_right<T>(
}
}
(ash, bsh) => {
if ash[0] == 0 || bsh[0] == 0 {
return;
}
let a_row_len = a_data.len() / ash[0];
let b_row_len = b_data.len() / bsh[0];
for (a, b) in a_data
Expand Down

0 comments on commit f19ec8b

Please sign in to comment.