ICU-8409 Calendar::fieldDifference perf improvment, better limit for binary search

X-SVN-Rev: 29735
This commit is contained in:
Peter Edberg 2011-04-05 05:26:13 +00:00
parent c00813396a
commit 24ad6686f7

View File

@ -1934,6 +1934,7 @@ int32_t Calendar::fieldDifference(UDate targetMs, UCalendarDateFields field, UEr
} else if (ms > targetMs) {
break;
} else {
min = max;
max <<= 1;
if (max < 0) {
// Field difference too large to fit into int32_t
@ -1971,6 +1972,7 @@ int32_t Calendar::fieldDifference(UDate targetMs, UCalendarDateFields field, UEr
} else if (ms < targetMs) {
break;
} else {
min = max;
max <<= 1;
if (max == 0) {
// Field difference too large to fit into int32_t