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

Unified Diff: third_party/WebKit/Source/core/html/forms/FormController.cpp

Issue 2556043002: Avoid WTF::Vector::at() and operator[] in core/html. (Closed)
Patch Set: _ Created 4 years 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/core/html/forms/FormController.cpp
diff --git a/third_party/WebKit/Source/core/html/forms/FormController.cpp b/third_party/WebKit/Source/core/html/forms/FormController.cpp
index 3849e8fa7b29367c28c66b32de2e114ef984ea14..f03e8544d1352b5332fd80c51cb8f55a1e532446 100644
--- a/third_party/WebKit/Source/core/html/forms/FormController.cpp
+++ b/third_party/WebKit/Source/core/html/forms/FormController.cpp
@@ -60,8 +60,8 @@ static inline HTMLFormElement* ownerFormForState(
void FormControlState::serializeTo(Vector<String>& stateVector) const {
DCHECK(!isFailure());
stateVector.append(String::number(m_values.size()));
- for (size_t i = 0; i < m_values.size(); ++i)
- stateVector.append(m_values[i].isNull() ? emptyString() : m_values[i]);
+ for (const auto& value : m_values)
+ stateVector.append(value.isNull() ? emptyString() : value);
}
FormControlState FormControlState::deserialize(
@@ -295,8 +295,8 @@ Vector<String> SavedFormState::getReferencedFilePaths() const {
const Vector<FileChooserFileInfo>& selectedFiles =
HTMLInputElement::filesFromFileInputFormControlState(
formControlState);
- for (size_t i = 0; i < selectedFiles.size(); ++i)
- toReturn.append(selectedFiles[i].path);
+ for (const auto& file : selectedFiles)
+ toReturn.append(file.path);
}
}
return toReturn;

Powered by Google App Engine
This is Rietveld 408576698