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

Unified Diff: runtime/bin/process_patch.dart

Issue 18031023: Remove _BufferList from dart:io and now use BytesBuilder. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Use takeBytes not toBytes. Created 7 years, 5 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 | « no previous file | sdk/lib/io/buffer_list.dart » ('j') | sdk/lib/io/bytes_builder.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/process_patch.dart
diff --git a/runtime/bin/process_patch.dart b/runtime/bin/process_patch.dart
index 65d271f0a1f447cc2786647413181183d62f9790..6d69139ab28c5aaff4e3bb47230b7366336a418c 100644
--- a/runtime/bin/process_patch.dart
+++ b/runtime/bin/process_patch.dart
@@ -359,13 +359,8 @@ Future<ProcessResult> _runNonInteractiveProcess(String path,
Future foldStream(Stream<List<int>> stream, Encoding encoding) {
if (encoding == null) {
return stream
- .fold(
- new _BufferList(),
- (buf, data) {
- buf.add(data);
- return buf;
- })
- .then((buf) => buf.readBytes());
+ .fold(new BytesBuilder(), (builder, data) => builder..add(data))
+ .then((builder) => builder.takeBytes());
} else {
return stream
.transform(new StringDecoder(encoding))
« no previous file with comments | « no previous file | sdk/lib/io/buffer_list.dart » ('j') | sdk/lib/io/bytes_builder.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698