From 818675e4c0927a4d40163b7b3d6a8be212832c66 Mon Sep 17 00:00:00 2001 From: dzaima Date: Thu, 9 Sep 2021 19:22:36 +0300 Subject: [PATCH] another place for arr_bptr --- src/utils/mut.h | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/utils/mut.h b/src/utils/mut.h index dc464b35..d9f7d62d 100644 --- a/src/utils/mut.h +++ b/src/utils/mut.h @@ -204,17 +204,14 @@ static void mut_copyG(Mut* m, usz ms, B x, usz xs, usz l) { assert(isArr(x)); } case el_B: { B* mpo = m->aB+ms; - B* xp; - if (xt==t_harr) xp = harr_ptr(x); - else if (xt==t_hslice) xp = c(HSlice,x)->a; - else if (xt==t_fillarr) xp = c(FillArr,x)->a; - else { - BS2B xget = TIi(xt,get); - for (usz i = 0; i < l; i++) mpo[i] = xget(x,i+xs); + B* xp = arr_bptr(x); + if (xp!=NULL) { + memcpy(mpo, xp+xs, l*sizeof(B*)); + for (usz i = 0; i < l; i++) inc(mpo[i]); return; } - memcpy(mpo, xp+xs, l*sizeof(B*)); - for (usz i = 0; i < l; i++) inc(mpo[i]); + BS2B xget = TIi(xt,get); + for (usz i = 0; i < l; i++) mpo[i] = xget(x,i+xs); return; } }