forked from mirrors/gecko-dev
Bug 1482011 - Make Bench_Cpp_MozHashSet more idiomatic. r=froydnj
I discovered there are some shortcut methods for some common operations. --HG-- extra : rebase_source : b22ca592af24857e093308d4b6351621062b8cea
This commit is contained in:
parent
6f0db984fe
commit
ce73ba39cf
1 changed files with 3 additions and 5 deletions
|
|
@ -176,20 +176,18 @@ Bench_Cpp_MozHashSet(const Params* aParams, void** aVals, size_t aLen)
|
|||
mozilla::HashSet<void*, mozilla::DefaultHasher<void*>, MallocAllocPolicy> hs;
|
||||
|
||||
for (size_t j = 0; j < aParams->mNumInserts; j++) {
|
||||
auto p = hs.lookupForAdd(aVals[j]);
|
||||
MOZ_RELEASE_ASSERT(!p);
|
||||
MOZ_RELEASE_ASSERT(hs.add(p, aVals[j]));
|
||||
MOZ_RELEASE_ASSERT(hs.put(aVals[j]));
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < aParams->mNumSuccessfulLookups; i++) {
|
||||
for (size_t j = 0; j < aParams->mNumInserts; j++) {
|
||||
MOZ_RELEASE_ASSERT(hs.lookup(aVals[j]));
|
||||
MOZ_RELEASE_ASSERT(hs.has(aVals[j]));
|
||||
}
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < aParams->mNumFailingLookups; i++) {
|
||||
for (size_t j = aParams->mNumInserts; j < aParams->mNumInserts*2; j++) {
|
||||
MOZ_RELEASE_ASSERT(!hs.lookup(aVals[j]));
|
||||
MOZ_RELEASE_ASSERT(!hs.has(aVals[j]));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue