From 797337b29bccb6732e5506180dbef9e10e89bf48 Mon Sep 17 00:00:00 2001 From: Syn Wee Quek Date: Wed, 24 Jul 2002 01:17:21 +0000 Subject: [PATCH] ICU-1923 updated compareUnsigned for optimization X-SVN-Rev: 9303 --- icu4j/src/com/ibm/icu/impl/Utility.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/icu4j/src/com/ibm/icu/impl/Utility.java b/icu4j/src/com/ibm/icu/impl/Utility.java index 3acd8a9a268..7030516fdd6 100755 --- a/icu4j/src/com/ibm/icu/impl/Utility.java +++ b/icu4j/src/com/ibm/icu/impl/Utility.java @@ -5,8 +5,8 @@ ******************************************************************************* * * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/impl/Utility.java,v $ - * $Date: 2002/07/17 23:48:06 $ - * $Revision: 1.26 $ + * $Date: 2002/07/24 01:17:21 $ + * $Revision: 1.27 $ * ***************************************************************************************** */ @@ -1540,10 +1540,15 @@ public final class Utility { if (source == target) { return 0; } - if ((long)(source & 0xFFFFFFFFL) > - (long)(target & 0xFFFFFFFFL)) { - return 1; + if (source >= 0) { + if (source < target || target < 0) { + return -1; + } + else if (source < target && target < 0) { + // source < 0, so + return -1; + } } - return -1; + return 1; } }