From fbe64193525211b27d3b80318edde364c26046ab Mon Sep 17 00:00:00 2001 From: Justin Lebar Date: Sun, 16 Oct 2011 15:28:36 -0400 Subject: [PATCH] Bug 164580 - Back out fix. It's not much (if at all) faster and may cause problems on some architectures. r=glandium --- xpcom/glue/nsID.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/xpcom/glue/nsID.h b/xpcom/glue/nsID.h index e635b68e3dd6..18d26fe1fb0b 100644 --- a/xpcom/glue/nsID.h +++ b/xpcom/glue/nsID.h @@ -73,10 +73,12 @@ struct nsID { */ inline bool Equals(const nsID& other) const { - // First cast to void* in order to silence the alignment warnings. + // Unfortunately memcmp isn't faster than this. return - ((PRUint64*)(void*) &m0)[0] == ((PRUint64*)(void*) &other.m0)[0] && - ((PRUint64*)(void*) &m0)[1] == ((PRUint64*)(void*) &other.m0)[1]; + ((((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])); } /**