diff --git a/src/xercesc/util/RefHash2KeysTableOf.c b/src/xercesc/util/RefHash2KeysTableOf.c
index 83c6a01200d43251aaae8f8b473a7714ac772a9d..4092d6332f19d2136a9c94fe1837c1fb89e6f425 100644
--- a/src/xercesc/util/RefHash2KeysTableOf.c
+++ b/src/xercesc/util/RefHash2KeysTableOf.c
@@ -56,6 +56,9 @@
 
 /**
  * $Log$
+ * Revision 1.9  2004/08/30 18:56:20  amassari
+ * Change the order of testing to save some CPU cycles
+ *
  * Revision 1.8  2004/08/30 15:18:35  amassari
  * - Added transferElement API
  * - The iterator class now can iterate over the items having the same primary key
@@ -375,7 +378,7 @@ findBucketElem(const void* const key1, const int key2, unsigned int& hashVal)
     RefHash2KeysTableBucketElem<TVal>* curElem = fBucketList[hashVal];
     while (curElem)
     {
-		if (fHash->equals(key1, curElem->fKey1) && (key2==curElem->fKey2))
+		if (key2==curElem->fKey2 && fHash->equals(key1, curElem->fKey1))
             return curElem;
 
         curElem = curElem->fNext;
diff --git a/src/xercesc/util/RefHash3KeysIdPool.c b/src/xercesc/util/RefHash3KeysIdPool.c
index 3cc863a16af29e30db89507279951d6f97c58213..f914c03ef63f1d2659810bf37ced330b20ef9fbe 100644
--- a/src/xercesc/util/RefHash3KeysIdPool.c
+++ b/src/xercesc/util/RefHash3KeysIdPool.c
@@ -56,6 +56,9 @@
 
 /**
  * $Log$
+ * Revision 1.12  2004/08/30 18:56:21  amassari
+ * Change the order of testing to save some CPU cycles
+ *
  * Revision 1.11  2004/03/01 15:03:08  peiyongz
  * new getter: getHashModulus
  *
@@ -431,7 +434,7 @@ findBucketElem(const void* const key1, const int key2, const int key3, unsigned
     RefHash3KeysTableBucketElem<TVal>* curElem = fBucketList[hashVal];
     while (curElem)
     {
-		if (fHash->equals(key1, curElem->fKey1) && (key2==curElem->fKey2) && (key3==curElem->fKey3))
+		if (key2==curElem->fKey2 && key3==curElem->fKey3 && fHash->equals(key1, curElem->fKey1))
             return curElem;
 
         curElem = curElem->fNext;