branchless compact

This commit is contained in:
Nikita Smith
2026-04-06 12:04:33 -07:00
parent 85ec2c6317
commit 232815dbe6
+3 -8
View File
@@ -1827,14 +1827,9 @@ THREAD_POOL_TASK_FUNC(lnk_move_global_symbols_to_gsi)
U32 *symbol_hashes = 0; // [symbol_count] U32 *symbol_hashes = 0; // [symbol_count]
if (task_id == 0) { if (task_id == 0) {
ProfBeginV("Compact Buckets [bucket_cap %llu]", bucket_cap); ProfBeginV("Compact Buckets [bucket_cap %llu]", bucket_cap);
{ for EachIndex(src, bucket_cap) {
U64 dst = 0; buckets[symbol_count] = buckets[src];
for EachIndex(src, bucket_cap) { symbol_count += buckets[src] != 0;
if (buckets[src] != 0) {
buckets[dst++] = buckets[src];
}
}
symbol_count = dst;
} }
ProfEnd(); ProfEnd();