961fdd8c | 08-Oct-2014 |
Adrien Destugues <pulkomandy@gmail.com> |
BMessageFormat: parse the pattern at construction
* Instead of parsing the pattern everytime Format() is called, parse it only once when the object is created. * Adjust all callers to make use of th
BMessageFormat: parse the pattern at construction
* Instead of parsing the pattern everytime Format() is called, parse it only once when the object is created. * Adjust all callers to make use of the feature and reuse the instance as much as possible. This also allows calling B_TRANSLATE only once instead of everytime the formatting needs to be done. We use either a static instance (when the message pattern is constant) or a field (when it is not known to be constant). * Since the BMessageFormat instances are now reused, add locking to avoid race conditions (ICU itself is thread safe, but the format pattern is recreated when the locale is changed)
show more ...
|