From 00a4a96a72a5c23329b4f70819451edc6258bfa1 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Tue, 4 Aug 2020 17:54:38 -0400 Subject: =?UTF-8?q?Faster=20singleton-cell=20comparison=20for=20=E2=8D=8B?= =?UTF-8?q?=E2=8D=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- impl.bqn | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/impl.bqn b/impl.bqn index b09e8081..8fdb7570 100644 --- a/impl.bqn +++ b/impl.bqn @@ -352,15 +352,14 @@ _cmpLen ← { } _getCellCmp ← { Ci←𝔽⋄l←𝕨⋄c←𝕩 - { + Cc←{ a←𝕨⋄b←𝕩 S←(l⊸=)◶{S∘(1+𝕩)⍟(0⊸=)a Ci○(𝕩⊸+)b}‿c S 0 } + (1≠l)⊑(𝕩⍟(0⊸=)𝔽)‿Cc } -Cmp ← ∨○IsArray◶{ # No arrays - 𝕨(>-<)𝕩 # Assume they're numbers -}‿{ # At least one array +Cmp ← ∨○IsArray◶(>-<)‿{ lc←𝕨(𝕨-○IsArray𝕩)_cmpLen○≢𝕩 cc ← (⊑⟜(⥊𝕨))⊸Cmp⟜(⊑⟜(⥊𝕩)) _getCellCmp´ lc Cc˜0 -- cgit v1.2.3