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

Unified Diff: sdk/lib/convert/byte_conversion.dart

Issue 20374003: Add transformer support to Converters. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Provide better types for bind. 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/convert/chunked_conversion.dart » ('j') | sdk/lib/convert/chunked_conversion.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/convert/byte_conversion.dart
diff --git a/sdk/lib/convert/byte_conversion.dart b/sdk/lib/convert/byte_conversion.dart
index d36f3ccd4efd44e102470c9f0643fda7ec674bda..edf297e1f8e91de6812bf6eca302bb9cae38a802 100644
--- a/sdk/lib/convert/byte_conversion.dart
+++ b/sdk/lib/convert/byte_conversion.dart
@@ -25,8 +25,8 @@ abstract class ByteConversionSink extends ChunkedConversionSink<List<int>> {
*
* If [isLast] is `true` closes `this`.
*
- * The given [chunk] is not held onto. Once the method returns, it is safe to
- * overwrite the data in it.
+ * Contrary to `add` the given [chunk] must not be held onto. Once the method
+ * returns, it is safe to overwrite the data in it.
*/
void addSlice(List<int> chunk, int start, int end, bool isLast);
@@ -44,11 +44,7 @@ abstract class ByteConversionSinkBase extends ByteConversionSink {
void close();
void addSlice(List<int> chunk, int start, int end, bool isLast) {
- if (start != 0 || end != chunk.length) {
- add(chunk.sublist(start, end));
- } else {
- add(chunk);
- }
+ add(chunk.sublist(start, end));
if (isLast) close();
}
}
« no previous file with comments | « no previous file | sdk/lib/convert/chunked_conversion.dart » ('j') | sdk/lib/convert/chunked_conversion.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698