ICU-8409 Calendar::fieldDifference perf improvment, better limit for binary search
X-SVN-Rev: 29735
This commit is contained in:
parent
c00813396a
commit
24ad6686f7
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user