hotspot/src/share/vm/libadt/dict.cpp
Print this page
rev 611 : Merge
*** 347,359 ****
//------------------------------Key Comparator Functions---------------------
int32 cmpstr(const void *k1, const void *k2) {
return strcmp((const char *)k1,(const char *)k2);
}
! // Slimey cheap key comparator.
int32 cmpkey(const void *key1, const void *key2) {
! return (int32)((intptr_t)key1 - (intptr_t)key2);
}
//=============================================================================
//------------------------------reset------------------------------------------
// Create an iterator and initialize the first variables.
--- 347,362 ----
//------------------------------Key Comparator Functions---------------------
int32 cmpstr(const void *k1, const void *k2) {
return strcmp((const char *)k1,(const char *)k2);
}
! // Cheap key comparator.
int32 cmpkey(const void *key1, const void *key2) {
! if (key1 == key2) return 0;
! intptr_t delta = (intptr_t)key1 - (intptr_t)key2;
! if (delta > 0) return 1;
! return -1;
}
//=============================================================================
//------------------------------reset------------------------------------------
// Create an iterator and initialize the first variables.