diff --git a/icu4c/source/common/uvector.cpp b/icu4c/source/common/uvector.cpp index 8e88edc874b..c275f55d224 100644 --- a/icu4c/source/common/uvector.cpp +++ b/icu4c/source/common/uvector.cpp @@ -20,8 +20,8 @@ U_NAMESPACE_BEGIN * or a pointer. If a hint bit is zero, then the associated * token is assumed to be an integer. This is needed for iSeries */ -#define HINT_KEY_POINTER (0) -#define HINT_KEY_INTEGER (1) +#define HINT_KEY_POINTER (1) +#define HINT_KEY_INTEGER (0) const char UVector::fgClassID=0; @@ -292,10 +292,14 @@ int32_t UVector::indexOf(UHashTok key, int32_t startIndex, int8_t hint) const { /* Pointers are not always the same size as ints so to perform * a valid comparision we need to know whether we are being * provided an int or a pointer. */ - if (((hint & HINT_KEY_INTEGER) && (key.integer == elements[i].integer)) - || (key.pointer == elements[i].pointer)) - { + if (hint & HINT_KEY_POINTER) { + if (key.pointer == elements[i].pointer) { return i; + } + } else { + if (key.integer == elements[i].integer) { + return i; + } } } }