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

Unified Diff: third_party/WebKit/Source/core/events/UIEventWithKeyState.cpp

Issue 2554953005: Avoid WTF::Vector::at() and operator[] in core/events. (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
« no previous file with comments | « third_party/WebKit/Source/core/events/TreeScopeEventContext.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/events/UIEventWithKeyState.cpp
diff --git a/third_party/WebKit/Source/core/events/UIEventWithKeyState.cpp b/third_party/WebKit/Source/core/events/UIEventWithKeyState.cpp
index 9ed546e003b93af22a56ef2644245e90b6679c07..7140b8e2e5941d657ad1f8186c105d39ca3c3276 100644
--- a/third_party/WebKit/Source/core/events/UIEventWithKeyState.cpp
+++ b/third_party/WebKit/Source/core/events/UIEventWithKeyState.cpp
@@ -129,9 +129,9 @@ bool UIEventWithKeyState::getModifierState(const String& keyIdentifier) const {
{"NumLock", PlatformEvent::NumLockOn},
{"Symbol", PlatformEvent::SymbolKey},
};
- for (size_t i = 0; i < WTF_ARRAY_LENGTH(kIdentifiers); ++i) {
- if (keyIdentifier == kIdentifiers[i].identifier)
- return m_modifiers & kIdentifiers[i].mask;
+ for (const auto& identifier : kIdentifiers) {
+ if (keyIdentifier == identifier.identifier)
+ return m_modifiers & identifier.mask;
}
return false;
}
« no previous file with comments | « third_party/WebKit/Source/core/events/TreeScopeEventContext.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698