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

Side by Side Diff: third_party/WebKit/Source/platform/fonts/ScriptRunIterator.cpp

Issue 2743023002: Migrate WTF::Deque::append() to ::push_back() (Closed)
Patch Set: rebase Created 3 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ScriptRunIterator.h" 5 #include "ScriptRunIterator.h"
6 6
7 #include "platform/text/ICUError.h" 7 #include "platform/text/ICUError.h"
8 #include "wtf/Threading.h" 8 #include "wtf/Threading.h"
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 return true; 175 return true;
176 } 176 }
177 177
178 void ScriptRunIterator::openBracket(UChar32 ch) { 178 void ScriptRunIterator::openBracket(UChar32 ch) {
179 if (m_brackets.size() == kMaxBrackets) { 179 if (m_brackets.size() == kMaxBrackets) {
180 m_brackets.removeFirst(); 180 m_brackets.removeFirst();
181 if (m_bracketsFixupDepth == kMaxBrackets) { 181 if (m_bracketsFixupDepth == kMaxBrackets) {
182 --m_bracketsFixupDepth; 182 --m_bracketsFixupDepth;
183 } 183 }
184 } 184 }
185 m_brackets.append(BracketRec({ch, USCRIPT_COMMON})); 185 m_brackets.push_back(BracketRec({ch, USCRIPT_COMMON}));
186 ++m_bracketsFixupDepth; 186 ++m_bracketsFixupDepth;
187 } 187 }
188 188
189 void ScriptRunIterator::closeBracket(UChar32 ch) { 189 void ScriptRunIterator::closeBracket(UChar32 ch) {
190 if (m_brackets.size() > 0) { 190 if (m_brackets.size() > 0) {
191 UChar32 target = m_scriptData->getPairedBracket(ch); 191 UChar32 target = m_scriptData->getPairedBracket(ch);
192 for (auto it = m_brackets.rbegin(); it != m_brackets.rend(); ++it) { 192 for (auto it = m_brackets.rbegin(); it != m_brackets.rend(); ++it) {
193 if (it->ch == target) { 193 if (it->ch == target) {
194 // Have a match, use open paren's resolved script. 194 // Have a match, use open paren's resolved script.
195 UScriptCode script = it->script; 195 UScriptCode script = it->script;
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 } 355 }
356 return true; 356 return true;
357 } 357 }
358 358
359 UScriptCode ScriptRunIterator::resolveCurrentScript() const { 359 UScriptCode ScriptRunIterator::resolveCurrentScript() const {
360 UScriptCode result = m_currentSet.at(0); 360 UScriptCode result = m_currentSet.at(0);
361 return result == USCRIPT_COMMON ? m_commonPreferred : result; 361 return result == USCRIPT_COMMON ? m_commonPreferred : result;
362 } 362 }
363 363
364 } // namespace blink 364 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698