mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-17 22:32:51 +00:00
Bug 1290614, part 7 - Further refactor XPCNativeSetKey::Hash. r=mrbkap
Now we can see what is really happening in Hash: first hash the interfaces from the base set, if any, then hash the additional interface, if any. Note that this function is wrong when mBaseSet is null. This will be fixed in bug 1290239. MozReview-Commit-ID: KaxQ57ofO1D --HG-- extra : rebase_source : 42012878839adb2e36580480abce7d9708288db4
This commit is contained in:
parent
bcc1ce175d
commit
b9fe49e715
@ -436,19 +436,16 @@ XPCNativeSetKey::Hash() const
|
||||
{
|
||||
PLDHashNumber h = 0;
|
||||
|
||||
if (!mBaseSet) {
|
||||
MOZ_ASSERT(mAddition, "bad key");
|
||||
h ^= HashPointer(mAddition);
|
||||
} else {
|
||||
if (mBaseSet) {
|
||||
XPCNativeInterface** current = mBaseSet->GetInterfaceArray();
|
||||
uint16_t count = mBaseSet->GetInterfaceCount();
|
||||
for (uint16_t i = 0; i < count; i++) {
|
||||
h ^= HashPointer(*(current++));
|
||||
}
|
||||
}
|
||||
|
||||
if (mAddition) {
|
||||
h ^= HashPointer(mAddition);
|
||||
}
|
||||
if (mAddition) {
|
||||
h ^= HashPointer(mAddition);
|
||||
}
|
||||
|
||||
return h;
|
||||
|
Loading…
x
Reference in New Issue
Block a user