Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(239)

Unified Diff: third_party/WebKit/Source/platform/text/Hyphenation.cpp

Issue 2163603002: Fix hyphenation for lang="de" and other fallback on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: eae review Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/text/Hyphenation.cpp
diff --git a/third_party/WebKit/Source/platform/text/Hyphenation.cpp b/third_party/WebKit/Source/platform/text/Hyphenation.cpp
index b636494c99e008b86f30b02fe60ab432e2195081..64405f6c756e9c56b5be098620747dddf0654391 100644
--- a/third_party/WebKit/Source/platform/text/Hyphenation.cpp
+++ b/third_party/WebKit/Source/platform/text/Hyphenation.cpp
@@ -18,10 +18,12 @@ Hyphenation* Hyphenation::get(const AtomicString& locale)
{
DCHECK(!locale.isNull());
Hyphenation::HyphenationMap& hyphenationMap = getHyphenationMap();
- auto result = hyphenationMap.add(locale, nullptr);
- if (result.isNewEntry)
- result.storedValue->value = platformGetHyphenation(locale);
- return result.storedValue->value.get();
+ const auto& it = hyphenationMap.find(locale);
+ if (it != hyphenationMap.end())
+ return it->value.get();
+
+ return hyphenationMap.add(locale, platformGetHyphenation(locale))
+ .storedValue->value.get();
}
void Hyphenation::setForTesting(const AtomicString& locale, PassRefPtr<Hyphenation> hyphenation)

Powered by Google App Engine
This is Rietveld 408576698