mirror of
https://review.haiku-os.org/haiku
synced 2025-01-21 22:04:49 +01:00
961fdd8cc3
* 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)