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

Side by Side Diff: sdk/lib/convert/string_conversion.dart

Issue 2705593002: Fix various nits in VM patch files. (Closed)
Patch Set: Address comments and issues found during testing. Created 3 years, 10 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
« no previous file with comments | « sdk/lib/collection/splay_tree.dart ('k') | sdk/lib/core/errors.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of dart.convert; 5 part of dart.convert;
6 6
7 /** 7 /**
8 * This class provides an interface for converters to 8 * This class provides an interface for converters to
9 * efficiently transmit String data. 9 * efficiently transmit String data.
10 * 10 *
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 ClosableStringSink asStringSink() { 186 ClosableStringSink asStringSink() {
187 return new _StringConversionSinkAsStringSinkAdapter(this); 187 return new _StringConversionSinkAsStringSinkAdapter(this);
188 } 188 }
189 } 189 }
190 190
191 /** 191 /**
192 * This class is a [StringConversionSink] that wraps a [StringSink]. 192 * This class is a [StringConversionSink] that wraps a [StringSink].
193 */ 193 */
194 class _StringSinkConversionSink extends StringConversionSinkBase { 194 class _StringSinkConversionSink extends StringConversionSinkBase {
195 StringSink _stringSink; 195 StringSink _stringSink;
196 _StringSinkConversionSink(StringSink this._stringSink); 196 _StringSinkConversionSink(this._stringSink);
197 197
198 void close() {} 198 void close() {}
199 void addSlice(String str, int start, int end, bool isLast) { 199 void addSlice(String str, int start, int end, bool isLast) {
200 if (start != 0 || end != str.length) { 200 if (start != 0 || end != str.length) {
201 for (int i = start; i < end; i++) { 201 for (int i = start; i < end; i++) {
202 _stringSink.writeCharCode(str.codeUnitAt(i)); 202 _stringSink.writeCharCode(str.codeUnitAt(i));
203 } 203 }
204 } else { 204 } else {
205 _stringSink.write(str); 205 _stringSink.write(str);
206 } 206 }
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 _decoder.convert(chunk, startIndex, endIndex); 333 _decoder.convert(chunk, startIndex, endIndex);
334 if (_buffer.isNotEmpty) { 334 if (_buffer.isNotEmpty) {
335 String accumulated = _buffer.toString(); 335 String accumulated = _buffer.toString();
336 _chunkedSink.addSlice(accumulated, 0, accumulated.length, isLast); 336 _chunkedSink.addSlice(accumulated, 0, accumulated.length, isLast);
337 _buffer.clear(); 337 _buffer.clear();
338 return; 338 return;
339 } 339 }
340 if (isLast) close(); 340 if (isLast) close();
341 } 341 }
342 } 342 }
OLDNEW
« no previous file with comments | « sdk/lib/collection/splay_tree.dart ('k') | sdk/lib/core/errors.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698