minor optimization

This commit is contained in:
Richard Thier 2025-09-12 01:49:20 +02:00
parent 5a8f34efa0
commit 2c5b0b1177

View File

@ -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 */
/* Rem.: This also changes bucket[i] so they will point to bucket beginnings */
#pragma GCC unroll 64
for(int i = n; i > 0; --i) {
uint32_t num = arr[i - 1];
for(int i = 0; i < n; ++i) {
uint32_t num = arr[i];
uint32_t witch = witch_bucket(num);
int offset = (--bucket[witch]);
temparr[offset] = num;