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

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: Merge to tip of tree. Created 6 years, 3 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..df7551a7540459a34f33812ed56975c385a8187d 100644
--- a/sdk/lib/convert/utf.dart
+++ b/sdk/lib/convert/utf.dart
@@ -436,12 +436,7 @@ 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));
}
int i = startIndex;
« no previous file with comments | « sdk/lib/convert/latin1.dart ('k') | sdk/lib/core/string.dart » ('j') | sdk/lib/core/string.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698