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

Unified Diff: utils/pub/utils.dart

Issue 12382031: Make pub warning-clean. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « utils/pub/log.dart ('k') | utils/pub/validator/name.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/utils.dart
diff --git a/utils/pub/utils.dart b/utils/pub/utils.dart
index 6fe071f65b2950c90ef5b88179d3f34686e0416c..186ecaa70126bafbbae0ae60597b47f813e26dc2 100644
--- a/utils/pub/utils.dart
+++ b/utils/pub/utils.dart
@@ -72,10 +72,10 @@ class FutureGroup<T> {
/// Pads [source] to [length] by adding spaces at the end.
String padRight(String source, int length) {
final result = new StringBuffer();
- result.add(source);
+ result.write(source);
while (result.length < length) {
- result.add(' ');
+ result.write(' ');
}
return result.toString();
@@ -122,11 +122,11 @@ String replace(String source, Pattern matcher, String fn(Match)) {
var buffer = new StringBuffer();
var start = 0;
for (var match in matcher.allMatches(source)) {
- buffer.add(source.substring(start, match.start));
+ buffer.write(source.substring(start, match.start));
start = match.end;
- buffer.add(fn(match));
+ buffer.write(fn(match));
}
- buffer.add(source.substring(start));
+ buffer.write(source.substring(start));
return buffer.toString();
}
@@ -242,14 +242,14 @@ Stream<String> streamToLines(Stream<String> stream) {
var leftover = lines.removeLast();
for (var line in lines) {
if (!buffer.isEmpty) {
- buffer.add(line);
+ buffer.write(line);
line = buffer.toString();
- buffer.clear();
+ buffer = new StringBuffer();
}
sink.add(line);
}
- buffer.add(leftover);
+ buffer.write(leftover);
},
handleDone: (sink) {
if (!buffer.isEmpty) sink.add(buffer.toString());
« no previous file with comments | « utils/pub/log.dart ('k') | utils/pub/validator/name.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698