summaryrefslogtreecommitdiffstats
path: root/xpcom/ds/nsIAtom.idl
diff options
context:
space:
mode:
authorMoonchild <git-repo@palemoon.org>2019-05-25 15:53:41 +0000
committerGitHub <noreply@github.com>2019-05-25 15:53:41 +0000
commit1f239f8179bce5df201ec486519efbda9d50861b (patch)
tree2772b5e52ff616f658d56a3f18247bfc700e5354 /xpcom/ds/nsIAtom.idl
parentc4e345b6d499393132c0cd57d10c98a7a4db370b (diff)
parentbf1e5431f05532e457306c0944b3812ab6ea39f2 (diff)
downloadUXP-1f239f8179bce5df201ec486519efbda9d50861b.tar
UXP-1f239f8179bce5df201ec486519efbda9d50861b.tar.gz
UXP-1f239f8179bce5df201ec486519efbda9d50861b.tar.lz
UXP-1f239f8179bce5df201ec486519efbda9d50861b.tar.xz
UXP-1f239f8179bce5df201ec486519efbda9d50861b.zip
Merge pull request #1121 from win7-7/nsHtml5PortabilitylocalEqualsBuffer-pr
Use memcmp in nsHtml5Portability::localEqualsBuffer
Diffstat (limited to 'xpcom/ds/nsIAtom.idl')
-rw-r--r--xpcom/ds/nsIAtom.idl10
1 files changed, 8 insertions, 2 deletions
diff --git a/xpcom/ds/nsIAtom.idl b/xpcom/ds/nsIAtom.idl
index 6e8602c42..ce4cff485 100644
--- a/xpcom/ds/nsIAtom.idl
+++ b/xpcom/ds/nsIAtom.idl
@@ -37,9 +37,15 @@ interface nsIAtom : nsISupports
size_t SizeOfIncludingThis(in MallocSizeOf aMallocSizeOf);
%{C++
- // note this is NOT virtual so this won't muck with the vtable!
+ // note these are NOT virtual so they won't muck with the vtable!
+ inline bool Equals(char16ptr_t aString, uint32_t aLength) const
+ {
+ return mLength == aLength &&
+ memcmp(mString, aString, mLength * sizeof(char16_t)) == 0;
+ }
+
inline bool Equals(const nsAString& aString) const {
- return aString.Equals(nsDependentString(mString, mLength));
+ return Equals(aString.BeginReading(), aString.Length());
}
inline bool IsStaticAtom() const {