We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
compar_int()
compar_special_int()
1 parent a5a4c91 commit 2a2d056Copy full SHA for 2a2d056
src/mfoc.c
@@ -1198,15 +1198,15 @@ uint32_t median(denonce d)
1198
1199
int compar_int(const void *a, const void *b)
1200
{
1201
- if (*(uint64_t *)b == *(uint64_t *)a) return 0;
1202
- if (*(uint64_t *)b < * (uint64_t *)a) return 1;
1203
- return -1;
+ uint64_t m = *(uint64_t *)a, n = *(uint64_t *)b;
+ return (m > n) - (m < n);
1204
}
1205
1206
// Compare countKeys structure
1207
int compar_special_int(const void *a, const void *b)
1208
1209
- return (((countKeys *)b)->count - ((countKeys *)a)->count);
+ int m = ((countKeys *)a)->count, n = ((countKeys *)b)->count;
1210
1211
1212
countKeys *uniqsort(uint64_t *possibleKeys, uint32_t size)
0 commit comments