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

Unified Diff: sdk/lib/_collection_dev/to_string.dart

Issue 12473003: Remove deprecated StringBuffer.add, addAll and addCharCode. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_collection_dev/to_string.dart
diff --git a/sdk/lib/_collection_dev/to_string.dart b/sdk/lib/_collection_dev/to_string.dart
index 21cbf0c5af5ecde7551b438d7eef2efe2a5772eb..f90ff183d00bb54d3da95ddb9da78f75d004d8d9 100644
--- a/sdk/lib/_collection_dev/to_string.dart
+++ b/sdk/lib/_collection_dev/to_string.dart
@@ -51,18 +51,18 @@ class ToString {
List visiting) {
visiting.add(c);
bool isList = c is List;
- result.add(isList ? '[' : '{');
+ result.write(isList ? '[' : '{');
bool first = true;
for (var e in c) {
if (!first) {
- result.add(', ');
+ result.write(', ');
}
first = false;
_emitObject(e, result, visiting);
}
- result.add(isList ? ']' : '}');
+ result.write(isList ? ']' : '}');
visiting.removeLast();
}
@@ -82,18 +82,18 @@ class ToString {
static void _emitObject(Object o, StringBuffer result, List visiting) {
if (o is Collection) {
if (_containsRef(visiting, o)) {
- result.add(o is List ? '[...]' : '{...}');
+ result.write(o is List ? '[...]' : '{...}');
} else {
_emitCollection(o, result, visiting);
}
} else if (o is Map) {
if (_containsRef(visiting, o)) {
- result.add('{...}');
+ result.write('{...}');
} else {
_emitMap(o, result, visiting);
}
} else { // o is neither a collection nor a map
- result.add(o);
+ result.write(o);
}
}
@@ -142,20 +142,20 @@ class ToString {
*/
static void _emitMap(Map m, StringBuffer result, List visiting) {
visiting.add(m);
- result.add('{');
+ result.write('{');
bool first = true;
m.forEach((k, v) {
if (!first) {
- result.add(', ');
+ result.write(', ');
}
first = false;
_emitObject(k, result, visiting);
- result.add(': ');
+ result.write(': ');
_emitObject(v, result, visiting);
});
- result.add('}');
+ result.write('}');
visiting.removeLast();
}
}

Powered by Google App Engine
This is Rietveld 408576698