From d13f3fad94665f8397550841bfbc5b8ee9f47797 Mon Sep 17 00:00:00 2001 From: dzaima Date: Wed, 19 Apr 2023 21:52:38 +0300 Subject: [PATCH] =?UTF-8?q?fix=20=E2=88=A7=F0=9D=95=A9=20&=20=E2=88=A8?= =?UTF-8?q?=F0=9D=95=A9=20on=20high-rank=20zero-cell=20input?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/builtins/grade.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/builtins/grade.h b/src/builtins/grade.h index 828a8e69..c8383273 100644 --- a/src/builtins/grade.h +++ b/src/builtins/grade.h @@ -171,9 +171,9 @@ extern i8 (*const avx2_count_i8)(usz*, i8*, u64, i8); #define SORT_C1 CAT(GRADE_UD(and,or),c1) B SORT_C1(B t, B x) { if (isAtm(x) || RNK(x)==0) thrM(GRADE_UD("∧","∨")": Argument cannot have rank 0"); - if (RNK(x)!=1) return bqn_merge(SORT_C1(t, toCells(x))); - usz n = IA(x); + usz n = *SH(x); if (n <= 1) return x; + if (RNK(x)!=1) return IA(x)<=1? x : bqn_merge(SORT_C1(t, toCells(x))); u8 xe = TI(x,elType); B r; if (xe==el_bit) {