fix arr_bptr==NULL path of isSorted
isSorted doesn't consume x, but TO_BPTR mutates it
This commit is contained in:
parent
e2c12d0ade
commit
32b37188d3
@ -389,8 +389,13 @@ bool CAT(isSorted,GRADE_UD(Up,Down))(B x) {
|
|||||||
#undef HI
|
#undef HI
|
||||||
}
|
}
|
||||||
case el_B: {
|
case el_B: {
|
||||||
B* xp = TO_BPTR(x);
|
B* xp = arr_bptr(x);
|
||||||
|
if (xp!=NULL) {
|
||||||
CMP(compare(xp[i-1], xp[i]) GRADE_UD(>,<) 0)
|
CMP(compare(xp[i-1], xp[i]) GRADE_UD(>,<) 0)
|
||||||
|
} else {
|
||||||
|
SGetU(x)
|
||||||
|
CMP(compare(GetU(x,i-1), GetU(x,i)) GRADE_UD(>,<) 0)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#undef CASE
|
#undef CASE
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user