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

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

Issue 515183002: Make String.fromCharCodes take start/end. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Don't say that end must be greater than start. Passing the actual length should be the same as pass… Created 6 years, 4 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/convert/utf.dart
diff --git a/sdk/lib/convert/utf.dart b/sdk/lib/convert/utf.dart
index 332598759af6b4276d9e36506699df1f656df2ae..59a21921866fb917a790d67f297fc64454644d61 100644
--- a/sdk/lib/convert/utf.dart
+++ b/sdk/lib/convert/utf.dart
@@ -436,12 +436,13 @@ class _Utf8Decoder {
void addSingleBytes(int from, int to) {
assert(from >= startIndex && from <= endIndex);
assert(to >= startIndex && to <= endIndex);
- if (from == 0 && to == codeUnits.length) {
- _stringSink.write(new String.fromCharCodes(codeUnits));
- } else {
- _stringSink.write(
- new String.fromCharCodes(codeUnits.sublist(from, to)));
- }
+ _stringSink.write(new String.fromCharCodes(codeUnits, from, to));
+ // if (from == 0 && to == codeUnits.length) {
+ // _stringSink.write(new String.fromCharCodes(codeUnits));
+ // } else {
+ // _stringSink.write(
+ // new String.fromCharCodes(codeUnits.sublist(from, to)));
+ // }
srdjan 2014/09/17 15:31:58 Remove dead code?
Lasse Reichstein Nielsen 2014/09/18 09:03:00 Done.
}
int i = startIndex;

Powered by Google App Engine
This is Rietveld 408576698