Compare commits
No commits in common. "0b864ad2f0eb302b8df8885086fbd6cb58af262f" and "5d6ea0e778aea1b291a716de1f531436a660410b" have entirely different histories.
0b864ad2f0
...
5d6ea0e778
18
qsort.h
18
qsort.h
@ -258,21 +258,19 @@ static inline pret3 partition3_sp2(uint32_t array[], int low, int high, uint32_t
|
|||||||
while(jl <= jr) {
|
while(jl <= jr) {
|
||||||
/* Handle left and find wrongly placed element */
|
/* Handle left and find wrongly placed element */
|
||||||
while((array[jl] <= pivotval) && (jl <= jr)) {
|
while((array[jl] <= pivotval) && (jl <= jr)) {
|
||||||
int isNonPivot = (array[jl] != pivotval);
|
if(array[jl] != pivotval) {
|
||||||
int nonSameIndex = (il + 1 != jl);
|
if(++il != jl)
|
||||||
if(isNonPivot & nonSameIndex)
|
swapit(&array[il], &array[jl]);
|
||||||
swapit(&array[il + 1], &array[jl]);
|
}
|
||||||
il += isNonPivot;
|
|
||||||
++jl;
|
++jl;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Handle right and find wrongly placed element */
|
/* Handle right and find wrongly placed element */
|
||||||
while((array[jr] >= pivotval) && (jl <= jr)) {
|
while((array[jr] >= pivotval) && (jl <= jr)) {
|
||||||
int isNonPivot = (array[jr] != pivotval);
|
if(array[jr] != pivotval) {
|
||||||
int nonSameIndex = (ir - 1 != jr);
|
if(--ir != jr)
|
||||||
if(isNonPivot & nonSameIndex)
|
swapit(&array[ir], &array[jr]);
|
||||||
swapit(&array[ir - 1], &array[jr]);
|
}
|
||||||
ir -= isNonPivot;
|
|
||||||
--jr;
|
--jr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user