This commit is contained in:
jst%netscape.com 2005-08-09 00:20:34 +00:00
Родитель a3f4aeef98
Коммит 44358c1363
1 изменённых файлов: 7 добавлений и 4 удалений

Просмотреть файл

@ -72,15 +72,18 @@ struct nsID {
*/ */
inline PRBool Equals(const nsID& other) const { inline PRBool Equals(const nsID& other) const {
#ifdef XP_UNIX // One would think that this could be done faster with a really
// efficient implementation of memcmp(), but evidently no
// memcmp()'s out there are better than this code.
//
// See bug http://bugzilla.mozilla.org/show_bug.cgi?id=164580 for
// details.
return (PRBool) return (PRBool)
((((PRUint32*) &m0)[0] == ((PRUint32*) &other.m0)[0]) && ((((PRUint32*) &m0)[0] == ((PRUint32*) &other.m0)[0]) &&
(((PRUint32*) &m0)[1] == ((PRUint32*) &other.m0)[1]) && (((PRUint32*) &m0)[1] == ((PRUint32*) &other.m0)[1]) &&
(((PRUint32*) &m0)[2] == ((PRUint32*) &other.m0)[2]) && (((PRUint32*) &m0)[2] == ((PRUint32*) &other.m0)[2]) &&
(((PRUint32*) &m0)[3] == ((PRUint32*) &other.m0)[3])); (((PRUint32*) &m0)[3] == ((PRUint32*) &other.m0)[3]));
#else
return (memcmp(this, &other, sizeof(*this)) == 0);
#endif
} }
/** /**