From 232815dbe6b145a1ba8be6aec32875b46272d438 Mon Sep 17 00:00:00 2001 From: Nikita Smith Date: Fri, 3 Apr 2026 11:38:22 -0700 Subject: [PATCH] branchless compact --- src/linker/lnk_debug_info.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/linker/lnk_debug_info.c b/src/linker/lnk_debug_info.c index 57704a7f..9d7ce0b4 100644 --- a/src/linker/lnk_debug_info.c +++ b/src/linker/lnk_debug_info.c @@ -1827,14 +1827,9 @@ THREAD_POOL_TASK_FUNC(lnk_move_global_symbols_to_gsi) U32 *symbol_hashes = 0; // [symbol_count] if (task_id == 0) { ProfBeginV("Compact Buckets [bucket_cap %llu]", bucket_cap); - { - U64 dst = 0; - for EachIndex(src, bucket_cap) { - if (buckets[src] != 0) { - buckets[dst++] = buckets[src]; - } - } - symbol_count = dst; + for EachIndex(src, bucket_cap) { + buckets[symbol_count] = buckets[src]; + symbol_count += buckets[src] != 0; } ProfEnd();