From 6257f12c1fdb16ecd761800ef0b956378cf88489 Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Thu, 12 Dec 2024 12:43:09 +0900 Subject: [PATCH] Simplify --- src/output-chunks.cc | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/output-chunks.cc b/src/output-chunks.cc index 753f47a1a3..2ba2c7aa6d 100644 --- a/src/output-chunks.cc +++ b/src/output-chunks.cc @@ -1931,17 +1931,14 @@ void HashSection::copy_buf(Context &ctx) { Entry *buckets = hdr + 2; Entry *chains = buckets + syms.size(); - hdr[0] = hdr[1] = syms.size(); - - std::vector hashes(syms.size()); - tbb::parallel_for((i64)1, (i64)syms.size(), [&](i64 i) { - hashes[i] = elf_hash(syms[i]->name()) % syms.size(); - }); - - for (i64 i = 1; i < syms.size(); i++) { - i64 h = hashes[i]; - chains[syms[i]->get_dynsym_idx(ctx)] = buckets[h]; - buckets[h] = syms[i]->get_dynsym_idx(ctx); + hdr[0] = syms.size(); + hdr[1] = syms.size(); + + for (Symbol *sym : syms.subspan(1)) { + i64 i = sym->get_dynsym_idx(ctx); + i64 h = elf_hash(sym->name()) % syms.size(); + chains[i] = buckets[h]; + buckets[h] = i; } }