зеркало из https://github.com/mozilla/pjs.git
Backing out the change to use memcmp() for comparing ID's. r=jaggernaut@netscape.com, sr=alecf@netscape.com, a=dbaron@dbaron.org.
This commit is contained in:
Родитель
a3f4aeef98
Коммит
44358c1363
|
@ -72,15 +72,18 @@ struct nsID {
|
|||
*/
|
||||
|
||||
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)
|
||||
((((PRUint32*) &m0)[0] == ((PRUint32*) &other.m0)[0]) &&
|
||||
(((PRUint32*) &m0)[1] == ((PRUint32*) &other.m0)[1]) &&
|
||||
(((PRUint32*) &m0)[2] == ((PRUint32*) &other.m0)[2]) &&
|
||||
(((PRUint32*) &m0)[3] == ((PRUint32*) &other.m0)[3]));
|
||||
#else
|
||||
return (memcmp(this, &other, sizeof(*this)) == 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Загрузка…
Ссылка в новой задаче