use reshape_one instead of manual mut_fill more
This commit is contained in:
parent
abb9adbc50
commit
634cf82fbe
@ -362,9 +362,7 @@ static NOINLINE B to_fill_cell(B x, ur k, u32 chr) { // consumes x
|
|||||||
usz* sh = SH(x)+k;
|
usz* sh = SH(x)+k;
|
||||||
usz csz = 1;
|
usz csz = 1;
|
||||||
for (usz i=0; i<cr; i++) if (mulOn(csz, sh[i])) thrF("%c: Empty argument too large (%H ≡ ≢𝕩)", chr, x);
|
for (usz i=0; i<cr; i++) if (mulOn(csz, sh[i])) thrF("%c: Empty argument too large (%H ≡ ≢𝕩)", chr, x);
|
||||||
MAKE_MUT(fc, csz);
|
Arr* ca = reshape_one(csz, xf);
|
||||||
mut_fill(fc, 0, xf, csz); dec(xf);
|
|
||||||
Arr* ca = mut_fp(fc);
|
|
||||||
usz* csh = arr_shAlloc(ca, cr);
|
usz* csh = arr_shAlloc(ca, cr);
|
||||||
if (cr>1) shcpy(csh, sh, cr);
|
if (cr>1) shcpy(csh, sh, cr);
|
||||||
decG(x);
|
decG(x);
|
||||||
|
|||||||
@ -368,10 +368,10 @@ B scan_c2(Md1D* d, B w, B x) { B f = d->f;
|
|||||||
if (ia==0) { dec(w); return x; }
|
if (ia==0) { dec(w); return x; }
|
||||||
if (RARE(!isFun(f))) {
|
if (RARE(!isFun(f))) {
|
||||||
if (isMd(f)) thrM("Calling a modifier");
|
if (isMd(f)) thrM("Calling a modifier");
|
||||||
|
Arr* ra = arr_shCopy(reshape_one(ia, inc(f)), x);
|
||||||
B xf = getFillR(x);
|
B xf = getFillR(x);
|
||||||
MAKE_MUT(rm, ia);
|
decG(x);
|
||||||
mut_fill(rm, 0, f, ia);
|
return withFill(taga(ra), xf);
|
||||||
return withFill(mut_fcd(rm, x), xf);
|
|
||||||
}
|
}
|
||||||
u8 xe = TI(x,elType);
|
u8 xe = TI(x,elType);
|
||||||
if (RTID(f) != RTID_NONE) {
|
if (RTID(f) != RTID_NONE) {
|
||||||
|
|||||||
@ -40,9 +40,13 @@ B eachd_fn(B fo, B w, B x, FC2 f) {
|
|||||||
if (ria==0) {
|
if (ria==0) {
|
||||||
rb = rM==1? emptyHVec() : m_harrUc(bo).b;
|
rb = rM==1? emptyHVec() : m_harrUc(bo).b;
|
||||||
} else if (f == arr_c2) {
|
} else if (f == arr_c2) {
|
||||||
|
if (EACH_FILLS) {
|
||||||
|
rb = taga(arr_shCopy(reshape_one(ria, inc(fo)), bo));
|
||||||
|
} else {
|
||||||
MAKE_MUT(rm, ria);
|
MAKE_MUT(rm, ria);
|
||||||
mut_fill(rm, 0, fo, ria);
|
mut_fill(rm, 0, fo, ria);
|
||||||
rb = mut_fc(rm, bo);
|
rb = mut_fc(rm, bo);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
M_HARR(r, ria)
|
M_HARR(r, ria)
|
||||||
if (wr==xr) { SGet(x) SGet(w) for(usz ri=0; ri<ria; ri++) HARR_ADD(r, ri, f(fo, Get(w,ri), Get(x,ri))); }
|
if (wr==xr) { SGet(x) SGet(w) for(usz ri=0; ri<ria; ri++) HARR_ADD(r, ri, f(fo, Get(w,ri), Get(x,ri))); }
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user