aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2021-04-09 11:00:55 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2021-04-09 11:00:55 -0400
commitf64156e1e19ac824b75f7a24ebdaa9c2cad5cdd7 (patch)
tree6f5b10038e70c1bed15e0aaac0d00a9773ac698f /src
parentd22b685b0135e0e36fa02b9e0f4336c6893d0b0f (diff)
Avoid testing for equality with Join (∾) in Insert (˝)
Diffstat (limited to 'src')
-rw-r--r--src/r.bqn8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/r.bqn b/src/r.bqn
index a2d15187..6f5b3859 100644
--- a/src/r.bqn
+++ b/src/r.bqn
@@ -43,9 +43,11 @@ _fold←{
}
´ ← _fold
+_qSearch ← {+´·×`𝕗(1-=)⌜<}
_glyphLookup_ ← {
- {PrimInd𝕩} ⊑ ((𝕘⊑˜·+´·×`𝕗(1-=)⌜<)⌜glyphs)˙
+ {PrimInd𝕩} ⊑ ((𝕘⊑˜𝕗_qSearch)⌜glyphs)˙
}
+IsJoin ← (glyphs _qSearch'∾') = {PrimInd𝕩}
Cell←{(𝕨⊸+⊑𝕩˙)⌜↕(≠𝕩)-𝕨}⟜≢
@@ -493,7 +495,7 @@ _insert←{
Id ← {
s ← 1 Drop ≢𝕩
JoinSh ← {"˝: Identity does not exist"!0<≠𝕨 ⋄ 𝕨×0<↕≠𝕨}
- s joinPrim˙⊸≠◶⟨JoinSh⥊𝕩˙, Reshape⟜Identity⟩ f
+ s ¬∘IsJoin∘⊢◶⟨JoinSh⥊𝕩˙, Reshape⟜Identity⟩ f
}
𝕨 (0<≠)⊘1◶Id‿{𝕨F´<˘𝕩} 𝕩
}
@@ -701,8 +703,6 @@ _repeat_←{
(|⊑<⟜0⊑pos‿neg˙)⚇0 n
}
-JoinPrim ← ∾
-
⍟ ↩ _repeat_
⥊ ↩ Deshape ⊘ Reshape
⌾ ← _under_