Skip to content

Commit

Permalink
fix a crash with fixed pervasive math
Browse files Browse the repository at this point in the history
  • Loading branch information
kaikalii committed Jan 10, 2024
1 parent 2bea80b commit d10706f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/algorithm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ where
.all(|(b, a)| b == a)
{
a.shape.drain(..fixes);
for &dim in b.shape[..fixes].iter().rev() {
for &dim in b.shape.iter().take(fixes).rev() {
a.reshape_scalar(dim);
}
}
Expand All @@ -177,7 +177,7 @@ where
.all(|(a, b)| a == b)
{
b.shape.drain(..fixes);
for &dim in a.shape[..fixes].iter().rev() {
for &dim in a.shape.iter().take(fixes).rev() {
b.reshape_scalar(dim);
}
}
Expand Down
1 change: 1 addition & 0 deletions tests/units.ua
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
⍤⊃⋅∘≍ [3_2_1 4_3_2 5_4_3] - ¤[1 2 3] [4 5 6]
⍤⊃⋅∘≍ 0_3 △ +¤ ↯3 0 ↯0_3 0
⍤⊃⋅∘≍ 1_3 △ +¤ ↯3 0 ↯1_3 0
⍤⊃⋅∘≍ ⇡10 + ¤¤0 ⇡10

# Filled pervasive math
⍤⊃⋅∘≍ [1_1 0_0] ⬚0↥ ↯ 2_2 0 ↯ 1_2 1
Expand Down

0 comments on commit d10706f

Please sign in to comment.