Bug 1379354 - Improve the UnicodeToEntity hashtable hash routine; r=wchen
authorEhsan Akhgari <ehsan@mozilla.com>
Sat, 08 Jul 2017 00:50:46 -0400
changeset 418421 20c8a416aefb8d813da394918a7f002c4cbf77ab
parent 418420 de19c8aec73da7df0ab4e1d60148f40d29935951
child 418422 b268982e5a349b24d7e775d15db72491c36c1d21
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswchen
bugs1379354
milestone56.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1379354 - Improve the UnicodeToEntity hashtable hash routine; r=wchen
parser/htmlparser/nsHTMLEntities.cpp
--- a/parser/htmlparser/nsHTMLEntities.cpp
+++ b/parser/htmlparser/nsHTMLEntities.cpp
@@ -28,17 +28,17 @@ static bool matchNodeUnicode(const PLDHa
   const EntityNodeEntry* entry = static_cast<const EntityNodeEntry*>(aHdr);
   const int32_t ucode = NS_PTR_TO_INT32(key);
   return (entry->node->mUnicode == ucode);
 }
 
 static PLDHashNumber hashUnicodeValue(const void* key)
 {
   // key is actually the unicode value
-  return PLDHashNumber(NS_PTR_TO_INT32(key));
+  return HashGeneric(key);
 }
 
 static const PLDHashTableOps UnicodeToEntityOps = {
   hashUnicodeValue,
   matchNodeUnicode,
   PLDHashTable::MoveEntryStub,
   PLDHashTable::ClearEntryStub,
   nullptr,