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:
jst%netscape.com 2003-02-11 02:05:20 +00:00
parent a14de23839
commit 953e3d4e09

View File

@ -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
}
/**