No need to initialize the negative half of the counts table
This commit is contained in:
parent
37af32d95c
commit
44c0baee05
@ -732,7 +732,8 @@ B slash_im(B t, B x) {
|
|||||||
max=xp[a-1]; \
|
max=xp[a-1]; \
|
||||||
if (a==xia) { /* Sorted unique argument */ \
|
if (a==xia) { /* Sorted unique argument */ \
|
||||||
usz ria = max + 1; \
|
usz ria = max + 1; \
|
||||||
u64* rp; r = m_bitarrv(&rp, ria); for (usz i=0; i<BIT_N(ria); i++) rp[i]=0; \
|
u64* rp; r = m_bitarrv(&rp, ria); \
|
||||||
|
for (usz i=0; i<BIT_N(ria); i++) rp[i]=0; \
|
||||||
for (usz i=0; i<xia; i++) bitp_set(rp, xp[i], 1); \
|
for (usz i=0; i<xia; i++) bitp_set(rp, xp[i], 1); \
|
||||||
decG(x); return r; \
|
decG(x); return r; \
|
||||||
} \
|
} \
|
||||||
@ -743,12 +744,12 @@ B slash_im(B t, B x) {
|
|||||||
i##N* rp; r = m_i##N##arrv(&rp, ria); for (usz i=0; i<ria; i++) rp[i]=0; \
|
i##N* rp; r = m_i##N##arrv(&rp, ria); for (usz i=0; i<ria; i++) rp[i]=0; \
|
||||||
for (usz i = 0; i < xia; i++) rp[xp[i]]++; \
|
for (usz i = 0; i < xia; i++) rp[xp[i]]++; \
|
||||||
} else { \
|
} else { \
|
||||||
TALLOC(usz, t, m); usz* th = t+m/2; \
|
TALLOC(usz, t, m); \
|
||||||
for (usz j=0; j<m ; j++) t[j]=0; \
|
for (usz j=0; j<m/2; j++) t[j]=0; \
|
||||||
for (usz i=0; i<xia; i++) th[xp[i]]++; \
|
for (usz i=0; i<xia; i++) t[(u##N)xp[i]]++; \
|
||||||
for (usz j=0; j<m/2; j++) if (t[j]) thrM("/⁼: Argument cannot contain negative numbers"); \
|
t[m/2]=xia; usz ria=0; for (usz s=0; s<xia; ria++) s+=t[ria]; \
|
||||||
usz ria=0; for (usz s=0; s<xia; ria++) s+=th[ria]; \
|
if (ria>m/2) thrM("/⁼: Argument cannot contain negative numbers"); \
|
||||||
i32* rp; r = m_i32arrv(&rp, ria); for (usz i=0; i<ria; i++) rp[i]=th[i]; \
|
i32* rp; r = m_i32arrv(&rp, ria); for (usz i=0; i<ria; i++) rp[i]=t[i]; \
|
||||||
TFREE(t); \
|
TFREE(t); \
|
||||||
} \
|
} \
|
||||||
decG(x); return num_squeeze(r); \
|
decG(x); return num_squeeze(r); \
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user