minor optimization
This commit is contained in:
parent
5a8f34efa0
commit
2c5b0b1177
@ -73,8 +73,8 @@ static inline void thiersort2(uint32_t *arr, uint32_t *temparr, int n, sch_rand_
|
|||||||
/* Move to the buckets - backwards going save a few cache miss */
|
/* Move to the buckets - backwards going save a few cache miss */
|
||||||
/* Rem.: This also changes bucket[i] so they will point to bucket beginnings */
|
/* Rem.: This also changes bucket[i] so they will point to bucket beginnings */
|
||||||
#pragma GCC unroll 64
|
#pragma GCC unroll 64
|
||||||
for(int i = n; i > 0; --i) {
|
for(int i = 0; i < n; ++i) {
|
||||||
uint32_t num = arr[i - 1];
|
uint32_t num = arr[i];
|
||||||
uint32_t witch = witch_bucket(num);
|
uint32_t witch = witch_bucket(num);
|
||||||
int offset = (--bucket[witch]);
|
int offset = (--bucket[witch]);
|
||||||
temparr[offset] = num;
|
temparr[offset] = num;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user