From 4450d3618790d01680655020fe67aee6de3f62d7 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Wed, 26 Jun 2024 14:59:45 -0400 Subject: [PATCH] =?UTF-8?q?Better=20handling=20for=20=C2=AB=CB=98=20and=20?= =?UTF-8?q?=C2=BB=CB=98=20trivial=20cases?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/builtins/cells.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/builtins/cells.c b/src/builtins/cells.c index c6ddcca4..13a47fb6 100644 --- a/src/builtins/cells.c +++ b/src/builtins/cells.c @@ -455,8 +455,12 @@ B for_cells_c1(B f, u32 xr, u32 cr, u32 k, B x, u32 chr) { // F⎉cr x, with arr return taga(arr_shReplace(r, k+1, rsh)); } case n_shifta: case n_shiftb: { - if (IA(x)==0) goto noSpecial; - if (cr!=1) goto base; + if (IA(x)==0) return x; + if (cr!=1) { + if (cr==0) goto base; + if (!(xsh[k]==1 // handled by fill case + || shProd(xsh, k+1, xr)==1)) goto base; + } B xf = getFillR(x); if (noFill(xf)) goto base; return shift_cells(xf, x, cam, xsh[k], TI(x,elType), rtid);