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

Side by Side Diff: third_party/WebKit/Source/core/html/parser/BackgroundHTMLInputStream.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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google, Inc. All Rights Reserved. 2 * Copyright (C) 2013 Google, Inc. All Rights Reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 m_segments.clear(); 108 m_segments.clear();
109 m_checkpoints.clear(); 109 m_checkpoints.clear();
110 m_firstValidCheckpointIndex = 0; 110 m_firstValidCheckpointIndex = 0;
111 m_firstValidSegmentIndex = 0; 111 m_firstValidSegmentIndex = 0;
112 112
113 updateTotalCheckpointTokenCount(); 113 updateTotalCheckpointTokenCount();
114 } 114 }
115 115
116 void BackgroundHTMLInputStream::updateTotalCheckpointTokenCount() { 116 void BackgroundHTMLInputStream::updateTotalCheckpointTokenCount() {
117 m_totalCheckpointTokenCount = 0; 117 m_totalCheckpointTokenCount = 0;
118 size_t lastCheckpointIndex = m_checkpoints.size(); 118 for (const auto& checkpoint : m_checkpoints) {
119 for (size_t i = 0; i < lastCheckpointIndex; ++i)
120 m_totalCheckpointTokenCount += 119 m_totalCheckpointTokenCount +=
121 m_checkpoints[i].tokensExtractedSincePreviousCheckpoint; 120 checkpoint.tokensExtractedSincePreviousCheckpoint;
121 }
122 } 122 }
123 123
124 } // namespace blink 124 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698