From f64156e1e19ac824b75f7a24ebdaa9c2cad5cdd7 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Fri, 9 Apr 2021 11:00:55 -0400 Subject: =?UTF-8?q?Avoid=20testing=20for=20equality=20with=20Join=20(?= =?UTF-8?q?=E2=88=BE)=20in=20Insert=20(=CB=9D)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/r.bqn | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') 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_ -- cgit v1.2.3