зеркало из https://github.com/mozilla/pjs.git
Bug 141173, TxObject::hashCode() and Map crash, PRInt32->PRUint32, r=peterv, sr=jaggernaut
This commit is contained in:
Родитель
19c0f123ff
Коммит
d5d0fff5ae
|
@ -149,7 +149,7 @@ void Map::put(TxObject* key, TxObject* obj) {
|
|||
if ((!key) || (!obj)) return;
|
||||
|
||||
//-- compute hash for key
|
||||
PRInt32 hashCode = key->hashCode();
|
||||
PRUint32 hashCode = key->hashCode();
|
||||
|
||||
//-- calculate index
|
||||
int idx = hashCode % numberOfBuckets;
|
||||
|
@ -197,7 +197,7 @@ TxObject* Map::remove(TxObject* key) {
|
|||
if (!key) return 0;
|
||||
|
||||
// compute hash for key
|
||||
PRInt32 hashCode = key->hashCode();
|
||||
PRUint32 hashCode = key->hashCode();
|
||||
|
||||
int idx = hashCode % numberOfBuckets;
|
||||
|
||||
|
@ -253,7 +253,7 @@ Map::BucketItem* Map::createBucketItem(TxObject* key, TxObject* obj)
|
|||
Map::BucketItem* Map::getBucketItem(TxObject* key) {
|
||||
|
||||
// compute hash for key
|
||||
PRInt32 hashCode = key->hashCode();
|
||||
PRUint32 hashCode = key->hashCode();
|
||||
|
||||
int idx = hashCode % numberOfBuckets;
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ class TxObject {
|
|||
/**
|
||||
* Returns the Hashcode for this TxObject
|
||||
**/
|
||||
virtual PRInt32 hashCode() {
|
||||
virtual PRUint32 hashCode() {
|
||||
return NS_PTR_TO_INT32(this);
|
||||
} //-- hashCode
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче