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

Unified Diff: third_party/WebKit/Source/core/html/track/AutomaticTrackSelection.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/track/AutomaticTrackSelection.cpp
diff --git a/third_party/WebKit/Source/core/html/track/AutomaticTrackSelection.cpp b/third_party/WebKit/Source/core/html/track/AutomaticTrackSelection.cpp
index ef7cc895e724b427d8d0a5b9295df000ac3c072f..651d79063da9e5a10cfdeca8fca508af274bff7a 100644
--- a/third_party/WebKit/Source/core/html/track/AutomaticTrackSelection.cpp
+++ b/third_party/WebKit/Source/core/html/track/AutomaticTrackSelection.cpp
@@ -75,9 +75,7 @@ void AutomaticTrackSelection::performAutomaticTextTrackSelection(
TextTrack* fallbackTrack = nullptr;
int highestTrackScore = 0;
- for (size_t i = 0; i < group.tracks.size(); ++i) {
- TextTrack* textTrack = group.tracks[i];
-
+ for (const auto& textTrack : group.tracks) {
if (m_configuration.disableCurrentlyEnabledTracks &&
textTrack->mode() == TextTrack::showingKeyword())
currentlyEnabledTracks.append(textTrack);
@@ -127,8 +125,7 @@ void AutomaticTrackSelection::performAutomaticTextTrackSelection(
}
if (currentlyEnabledTracks.size()) {
- for (size_t i = 0; i < currentlyEnabledTracks.size(); ++i) {
- TextTrack* textTrack = currentlyEnabledTracks[i];
+ for (const auto& textTrack : currentlyEnabledTracks) {
if (textTrack != trackToEnable)
textTrack->setMode(TextTrack::disabledKeyword());
}

Powered by Google App Engine
This is Rietveld 408576698