src/share/vm/libadt/dict.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File 6798785 Cdiff src/share/vm/libadt/dict.cpp

src/share/vm/libadt/dict.cpp

Print this page

        

*** 344,356 **** //------------------------------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. --- 344,359 ---- //------------------------------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.
src/share/vm/libadt/dict.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File