[INTL] improve efficiency of Intl.NumberFormat formatToParts
authorandy@vanwagoner.family <andy@vanwagoner.family@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Feb 2019 22:09:32 +0000 (22:09 +0000)
committerandy@vanwagoner.family <andy@vanwagoner.family@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Feb 2019 22:09:32 +0000 (22:09 +0000)
commitd7e7ae6ae7959f66e64c2b675f73a7af9eb4a274
tree8cb57e21d311cbc7f64c85fc19cf37453895b104
parentaa5a23f2cd5e67535abb4625ea36ac87579eef75
[INTL] improve efficiency of Intl.NumberFormat formatToParts
https://bugs.webkit.org/show_bug.cgi?id=185557

Reviewed by Mark Lam.

Since field nesting depth is minimal, this algorithm should be effectively O(n),
where n is the number of characters in the formatted string.
It may be less memory efficient than the previous impl, since the intermediate Vector
is the length of the string, instead of the count of the fields.

* runtime/IntlNumberFormat.cpp:
(JSC::IntlNumberFormat::formatToParts):
* runtime/IntlNumberFormat.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240992 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/IntlNumberFormat.cpp
Source/JavaScriptCore/runtime/IntlNumberFormat.h