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

Unified Diff: Source/web/WebSearchableFormData.cpp

Issue 1314013007: Merge odd items and even items of FormDataList::m_items. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 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 | « Source/core/html/FormDataList.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebSearchableFormData.cpp
diff --git a/Source/web/WebSearchableFormData.cpp b/Source/web/WebSearchableFormData.cpp
index e6cb9e2db0347c8305e0ddf7b71ba7b437ff770c..e23b166cea87218de945a567dc0475c6cd90beea 100644
--- a/Source/web/WebSearchableFormData.cpp
+++ b/Source/web/WebSearchableFormData.cpp
@@ -214,18 +214,17 @@ bool buildSearchString(const HTMLFormElement* form, Vector<char>* encodedString,
if (!control->appendFormData(*dataList, false))
continue;
- const FormDataList::FormDataListItems& items = dataList->items();
- for (FormDataList::FormDataListItems::const_iterator j(items.begin()); j != items.end(); ++j) {
+ for (const FormDataList::Item& item : dataList->items()) {
if (!encodedString->isEmpty())
encodedString->append('&');
- FormDataBuilder::encodeStringAsFormData(*encodedString, j->data());
+ FormDataBuilder::encodeStringAsFormData(*encodedString, item.key());
encodedString->append('=');
- ++j;
if (control == textElement) {
encodedString->append("{searchTerms}", 13);
isElementFound = true;
- } else
- FormDataBuilder::encodeStringAsFormData(*encodedString, j->data());
+ } else {
+ FormDataBuilder::encodeStringAsFormData(*encodedString, item.data());
+ }
}
}
return isElementFound;
« no previous file with comments | « Source/core/html/FormDataList.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698