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

Side by Side Diff: Source/core/css/CSSSelectorList.cpp

Issue 482753002: Use StringBuilder::appendLiteral() / StringBuilder::append(char) when possible (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/css/CSSPropertySourceData.cpp ('k') | Source/core/css/CSSStyleRule.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2008, 2012 Apple Inc. All rights reserved.
3 * Copyright (C) 2009 Google Inc. All rights reserved. 3 * Copyright (C) 2009 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 107
108 fastFree(m_selectorArray); 108 fastFree(m_selectorArray);
109 } 109 }
110 110
111 String CSSSelectorList::selectorsText() const 111 String CSSSelectorList::selectorsText() const
112 { 112 {
113 StringBuilder result; 113 StringBuilder result;
114 114
115 for (const CSSSelector* s = first(); s; s = next(*s)) { 115 for (const CSSSelector* s = first(); s; s = next(*s)) {
116 if (s != first()) 116 if (s != first())
117 result.append(", "); 117 result.appendLiteral(", ");
118 result.append(s->selectorText()); 118 result.append(s->selectorText());
119 } 119 }
120 120
121 return result.toString(); 121 return result.toString();
122 } 122 }
123 123
124 template <typename Functor> 124 template <typename Functor>
125 static bool forEachTagSelector(Functor& functor, const CSSSelector& selector) 125 static bool forEachTagSelector(Functor& functor, const CSSSelector& selector)
126 { 126 {
127 for (const CSSSelector* current = &selector; current; current = current->tag History()) { 127 for (const CSSSelector* current = &selector; current; current = current->tag History()) {
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 } 189 }
190 }; 190 };
191 191
192 bool CSSSelectorList::selectorCrossesTreeScopes(size_t index) const 192 bool CSSSelectorList::selectorCrossesTreeScopes(size_t index) const
193 { 193 {
194 SelectorCrossesTreeScopes functor; 194 SelectorCrossesTreeScopes functor;
195 return forEachTagSelector(functor, selectorAt(index)); 195 return forEachTagSelector(functor, selectorAt(index));
196 } 196 }
197 197
198 } // namespace blink 198 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/css/CSSPropertySourceData.cpp ('k') | Source/core/css/CSSStyleRule.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698