From 3f0c34e8957699fad9f1df4f48bd4004eb7c2782 Mon Sep 17 00:00:00 2001 From: dzaima Date: Thu, 29 Dec 2022 20:41:43 +0200 Subject: [PATCH] =?UTF-8?q?fast=20=E2=89=8D=CB=98=F0=9D=95=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/builtins/md1.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/builtins/md1.c b/src/builtins/md1.c index 74cdc686..bc6abaeb 100644 --- a/src/builtins/md1.c +++ b/src/builtins/md1.c @@ -273,8 +273,18 @@ B cell_c1(Md1D* d, B x) { B f = d->f; if (IA(x)!=0 && isFun(f)) { u8 rtid = v(f)->flags-1; - if (rtid==n_lt && RNK(x)>1) return toCells(x); - if (rtid==n_select && RNK(x)>1) return select_cells(0, x, RNK(x)); + ur xr = RNK(x); + if (rtid==n_lt && xr>1) return toCells(x); + if (rtid==n_select && xr>1) return select_cells(0, x, xr); + if (rtid==n_couple && xr>0) { + ShArr* rsh = m_shArr(xr+1); + usz* xsh = SH(x); + rsh->a[0] = xsh[0]; + rsh->a[1] = 1; + shcpy(rsh->a+2, xsh+1, xr-1); + Arr* r = TI(x,slice)(x, 0, IA(x)); + return taga(arr_shSetU(r, xr+1, rsh)); + } } usz cam = SH(x)[0];