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

Unified Diff: Source/core/dom/SpaceSplitString.cpp

Issue 1167693004: Make SpaceSplitString::set() faster (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/SpaceSplitString.cpp
diff --git a/Source/core/dom/SpaceSplitString.cpp b/Source/core/dom/SpaceSplitString.cpp
index 0b90f84eb9ae4ecb342a5a611aefb6ab39ec1c14..4b65c887575e74c5226c83e07c2786aecc426165 100644
--- a/Source/core/dom/SpaceSplitString.cpp
+++ b/Source/core/dom/SpaceSplitString.cpp
@@ -158,11 +158,13 @@ void SpaceSplitString::set(const AtomicString& inputString, CaseFolding caseFold
return;
}
- String string(inputString.string());
- if (caseFolding == ShouldFoldCase && hasNonASCIIOrUpper(string))
+ if (caseFolding == ShouldFoldCase && hasNonASCIIOrUpper(inputString.string())) {
+ String string(inputString.string());
string = string.foldCase();
-
- m_data = Data::create(AtomicString(string));
+ m_data = Data::create(AtomicString(string));
+ } else {
+ m_data = Data::create(inputString);
+ }
}
SpaceSplitString::Data::~Data()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698