Handle cell size 0 correctly in cellWidthLog()
This commit is contained in:
parent
c72b9b5abd
commit
ea1367e639
@ -65,7 +65,6 @@ static u8 cellWidthLog(B x) {
|
||||
u8 lw = arrTypeBitsLog(TY(x));
|
||||
if (LIKELY(RNK(x)==1)) return lw;
|
||||
usz csz = arr_csz(x);
|
||||
if (csz & (csz-1)) return 7; // Not power of 2
|
||||
lw += CTZ(csz);
|
||||
return lw<7? lw : 7;
|
||||
if (csz & (csz-1)) return 7; // Not power of 2
|
||||
return lw + CTZ(csz | 128>>lw); // Max of 7; also handle csz==0
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user