Bug 1290614, part 6 - Hoist out the common loop over all interfaces in XPCNativeSetKey::Hash(). r=mrbkap

Both cases first hash together all of the existing interfaces.

MozReview-Commit-ID: AnUF5uPSPpN

--HG--
extra : rebase_source : 43ac016974d3ee4dfbd92361348aeeae5b6a793c
This commit is contained in:
Andrew McCreight 2016-07-31 14:16:52 -07:00
Родитель c2ef63a1b9
Коммит bcc1ce175d
1 изменённых файлов: 4 добавлений и 6 удалений

Просмотреть файл

@ -442,14 +442,12 @@ XPCNativeSetKey::Hash() const
} else { } else {
XPCNativeInterface** current = mBaseSet->GetInterfaceArray(); XPCNativeInterface** current = mBaseSet->GetInterfaceArray();
uint16_t count = mBaseSet->GetInterfaceCount(); uint16_t count = mBaseSet->GetInterfaceCount();
for (uint16_t i = 0; i < count; i++) {
h ^= HashPointer(*(current++));
}
if (mAddition) { if (mAddition) {
for (uint16_t i = 0; i < count; i++) {
h ^= HashPointer(*(current++));
}
h ^= HashPointer(mAddition); h ^= HashPointer(mAddition);
} else {
for (uint16_t i = 0; i < count; i++)
h ^= HashPointer(*(current++));
} }
} }