aboutsummaryrefslogtreecommitdiff
path: root/deps/v8/src/objects/js-segmenter.cc
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/objects/js-segmenter.cc')
-rw-r--r--deps/v8/src/objects/js-segmenter.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/deps/v8/src/objects/js-segmenter.cc b/deps/v8/src/objects/js-segmenter.cc
index aba1c7bdf2..7548b65f23 100644
--- a/deps/v8/src/objects/js-segmenter.cc
+++ b/deps/v8/src/objects/js-segmenter.cc
@@ -162,11 +162,10 @@ Handle<String> JSSegmenter::GranularityAsString() const {
}
}
-std::set<std::string> JSSegmenter::GetAvailableLocales() {
- int32_t num_locales = 0;
- const icu::Locale* icu_available_locales =
- icu::BreakIterator::getAvailableLocales(num_locales);
- return Intl::BuildLocaleSet(icu_available_locales, num_locales);
+const std::set<std::string>& JSSegmenter::GetAvailableLocales() {
+ static base::LazyInstance<Intl::AvailableLocales<icu::BreakIterator>>::type
+ available_locales = LAZY_INSTANCE_INITIALIZER;
+ return available_locales.Pointer()->Get();
}
} // namespace internal