зеркало из https://github.com/mozilla/gecko-dev.git
Bug 551736: Add parens around right-shift, to fix compile warning and make sure we construct hash value correctly. r=sicking
This commit is contained in:
Родитель
51582e89d2
Коммит
7f63efa6df
|
@ -50,9 +50,12 @@ nsSMILCompositor::KeyEquals(KeyTypePointer aKey) const
|
|||
/*static*/ PLDHashNumber
|
||||
nsSMILCompositor::HashKey(KeyTypePointer aKey)
|
||||
{
|
||||
// Combine the 3 values into one numeric value, which will be hashed
|
||||
return NS_PTR_TO_UINT32(aKey->mElement.get()) >> 4 +
|
||||
NS_PTR_TO_INT32(aKey->mAttributeName.get()) +
|
||||
// Combine the 3 values into one numeric value, which will be hashed.
|
||||
// NOTE: We right-shift one of the pointers by 2 to get some randomness in
|
||||
// its 2 lowest-order bits. (Those shifted-off bits will always be 0 since
|
||||
// our pointers will be word-aligned.)
|
||||
return (NS_PTR_TO_UINT32(aKey->mElement.get()) >> 2) +
|
||||
NS_PTR_TO_UINT32(aKey->mAttributeName.get()) +
|
||||
(aKey->mIsCSS ? 1 : 0);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче