ELF2: Simplify by removing temporary variables.

llvm-svn: 247652
This commit is contained in:
Rui Ueyama 2015-09-15 01:03:58 +00:00
parent d558aa8627
commit b73002fb4e
1 changed files with 2 additions and 7 deletions

View File

@ -237,19 +237,14 @@ public:
*P++ = NumSymbols; // nbucket
*P++ = NumSymbols; // nchain
std::vector<uint32_t> Buckets(NumSymbols);
std::vector<uint32_t> Chains(NumSymbols);
Elf_Word *Buckets = P;
Elf_Word *Chains = P + NumSymbols;
for (unsigned I = 1; I < NumSymbols; ++I) {
uint32_t Hash = Hashes[I - 1] % NumSymbols;
Chains[I] = Buckets[Hash];
Buckets[Hash] = I;
}
for (uint32_t V : Buckets)
*P++ = V;
for (uint32_t V : Chains)
*P++ = V;
}
SymbolTableSection<ELFT> &getDynSymSec() { return DynSymSec; }