use memcmp for nsIAtom Equals to improve performance xpcom/ds

issue #1113 Use memcmp and not slower string Equals in nsHtml5Portability::localEqualsBuffer
This commit is contained in:
win7-7 2019-05-25 18:02:40 +03:00 committed by Roy Tam
commit 03bf12d98e
2 changed files with 9 additions and 9 deletions

View file

@ -325,13 +325,7 @@ AtomTableMatchKey(const PLDHashEntryHdr* aEntry, const void* aKey)
nsDependentAtomString(he->mAtom)) == 0;
}
uint32_t length = he->mAtom->GetLength();
if (length != k->mLength) {
return false;
}
return memcmp(he->mAtom->GetUTF16String(),
k->mUTF16String, length * sizeof(char16_t)) == 0;
return he->mAtom->Equals(k->mUTF16String, k->mLength);
}
static void