aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2022-09-07 19:00:13 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2022-09-07 19:00:13 -0400
commit3d613e00b4560a453b162f32c78ea4a6ee452842 (patch)
tree8157c894ec22a5775475000aae5f819cdadb7528 /src
parentc7cdf25ad5b35df4f1ba1d2a8af91ab942190f83 (diff)
Avoid memory blowup in _multiAxis
Diffstat (limited to 'src')
-rw-r--r--src/r1.bqn3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/r1.bqn b/src/r1.bqn
index 5e4397a4..55cff957 100644
--- a/src/r1.bqn
+++ b/src/r1.bqn
@@ -293,7 +293,8 @@ _multiAxis←{
Test∘⊣◶{ # Multiple axes
er ! 1≥=𝕨 ⋄ TT 𝕨
l←≠𝕨↩⥊𝕨 ⋄ el ! l≤=𝕩
- j←<0 ⋄ 𝕨 { j↩(×⟜𝕩⌜j)+⌜𝕨Ind𝕩 }¨ p←l↑s←≢𝕩
+ i←𝕨Ind¨p←l↑s←≢𝕩
+ j←i (0<1×´≠∘⥊⌜i)◶⟨{⟨⟩⥊˜Join1≢⌜𝕨}, {j←<0⋄𝕨{j↩(j×⌜<𝕩)+⌜𝕨}¨𝕩⋄j}⟩ p
j ⊏ (⟨1×´p⟩∾l↓s)⥊𝕩
}‿{
es ! 1≤=𝕩