llvm-dwp: Simplify hashing code a bit

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265426 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Blaikie 2016-04-05 17:51:40 +00:00
parent 503ff5bcee
commit 037ba978f5

View File

@ -288,10 +288,11 @@ writeIndex(MCStreamer &Out, MCSection *Section,
for (const auto &P : IndexEntries) {
auto S = P.first;
auto H = S & Mask;
auto HP = ((S >> 32) & Mask) | 1;
while (Buckets[H]) {
assert(S != IndexEntries.begin()[Buckets[H] - 1].first &&
"Duplicate unit");
H = (H + (((S >> 32) & Mask) | 1)) % Buckets.size();
H = (H + HP) & Mask;
}
Buckets[H] = i + 1;
++i;