more switch cleanup

This commit is contained in:
dzaima 2022-05-01 04:43:04 +03:00
parent f12e5fd1c0
commit 3496a939b6
2 changed files with 7 additions and 10 deletions

View File

@ -590,7 +590,7 @@ B slash_im(B t, B x) {
u8 xe = TI(x,elType);
usz xia = a(x)->ia;
if (xia==0) { decG(x); return emptyIVec(); }
switch(xe) {
switch(xe) { default: UD;
case el_i8: {
i8* xp = i8any_ptr(x);
usz i,j; B r; i8 max=-1;
@ -651,7 +651,7 @@ B slash_im(B t, B x) {
}
decG(x); return r;
}
default: {
case el_bit: case el_c8: case el_c16: case el_c32: case el_B: {
SLOW1("/⁼", x);
B* xp = arr_bptr(x);
if (xp==NULL) { HArr* xa=cpyHArr(x); x=taga(xa); xp=xa->a; }

View File

@ -50,14 +50,11 @@ static void mut_init(Mut* m, u8 n) {
usz sz;
// hack around inlining of the allocator too many times
switch(n) { default: UD;
case el_bit: sz = BITARR_SZ( ia); break;
case el_i8: sz = TYARR_SZ(I8, ia); break;
case el_i16: sz = TYARR_SZ(I16,ia); break;
case el_i32: sz = TYARR_SZ(I32,ia); break;
case el_c8: sz = TYARR_SZ(C8, ia); break;
case el_c16: sz = TYARR_SZ(C16,ia); break;
case el_c32: sz = TYARR_SZ(C32,ia); break;
case el_f64: sz = TYARR_SZ(F64,ia); break;
case el_bit: sz = BITARR_SZ( ia); break;
case el_i8: case el_c8: sz = TYARR_SZ(I8, ia); break;
case el_i16: case el_c16: sz = TYARR_SZ(I16,ia); break;
case el_i32: case el_c32: sz = TYARR_SZ(I32,ia); break;
case el_f64: sz = TYARR_SZ(F64,ia); break;
case el_B:;
HArr_p t = m_harrUp(ia);
m->val = (Arr*)t.c;