]> granicus.if.org Git - icu/commit
More readable binarySearch at 4x worst-case cost.
authorHugo van der Merwe <17109322+hugovdm@users.noreply.github.com>
Tue, 5 May 2020 12:40:34 +0000 (14:40 +0200)
committerHugo van der Merwe <17109322+hugovdm@users.noreply.github.com>
Tue, 5 May 2020 12:41:49 +0000 (14:41 +0200)
commitab4087b670f3948c4733fc8eaad0b3d4b1b9d279
tree82034b17756fc31569582b3cfaeaa296a22828ca
parent86cdb4171271caaf726f89cea22336e648a01ded
More readable binarySearch at 4x worst-case cost.

With this hopefully more readable version, looking for an unknown
usage and region will result in the binary search being repeated four
times.

The previous version did not use a metadata instance comparator so
that individual components of the metadata key could be compared. A
comparator that returns status information on which of the components
had been found would be able to improve on this.
icu4c/source/i18n/unitsdata.cpp