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

Side by Side Diff: runtime/lib/string_buffer_patch.dart

Issue 12295014: Remove deprecated Strings class. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « pkg/yaml/test/yaml_test.dart ('k') | runtime/lib/string_patch.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 patch class StringBuffer { 5 patch class StringBuffer {
6 List<String> _buffer; 6 List<String> _buffer;
7 int _length; 7 int _length;
8 8
9 /// Creates the string buffer with an initial content. 9 /// Creates the string buffer with an initial content.
10 /* patch */ StringBuffer([Object content = ""]) { 10 /* patch */ StringBuffer([Object content = ""]) {
(...skipping 25 matching lines...) Expand all
36 /// Clears the string buffer. 36 /// Clears the string buffer.
37 /* patch */ void clear() { 37 /* patch */ void clear() {
38 _buffer = new List<String>(); 38 _buffer = new List<String>();
39 _length = 0; 39 _length = 0;
40 } 40 }
41 41
42 /// Returns the contents of buffer as a concatenated string. 42 /// Returns the contents of buffer as a concatenated string.
43 /* patch */ String toString() { 43 /* patch */ String toString() {
44 if (_buffer.length == 0) return ""; 44 if (_buffer.length == 0) return "";
45 if (_buffer.length == 1) return _buffer[0]; 45 if (_buffer.length == 1) return _buffer[0];
46 String result = Strings.concatAll(_buffer); 46 String result = _StringBase.concatAll(_buffer);
47 _buffer.clear(); 47 _buffer.clear();
48 _buffer.add(result); 48 _buffer.add(result);
49 // Since we track the length at each add operation, there is no 49 // Since we track the length at each add operation, there is no
50 // need to update it in this function. 50 // need to update it in this function.
51 return result; 51 return result;
52 } 52 }
53 } 53 }
OLDNEW
« no previous file with comments | « pkg/yaml/test/yaml_test.dart ('k') | runtime/lib/string_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698