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

Unified Diff: pkg/compiler/lib/src/scanner/token.dart

Issue 1076793002: Use range-arguments to avoid sublist-iterable and sublists. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/scanner/token.dart
diff --git a/pkg/compiler/lib/src/scanner/token.dart b/pkg/compiler/lib/src/scanner/token.dart
index 483eda9fcf3d68aed4932ae4bf14a5530b0870ef..76229cd40b80016426343386ba69139551926d03 100644
--- a/pkg/compiler/lib/src/scanner/token.dart
+++ b/pkg/compiler/lib/src/scanner/token.dart
@@ -385,12 +385,9 @@ class StringToken extends Token {
static String decodeUtf8(List<int> data, int start, int end, bool asciiOnly) {
var s;
if (asciiOnly) {
- // getRange returns an iterator, it does not copy the data.
- s = new String.fromCharCodes(data.getRange(start, end));
+ s = new String.fromCharCodes(data, start, end);
} else {
- // TODO(lry): this is measurably slow. Also sublist is copied eagerly.
- var bytes = data.sublist(start, end);
- s = UTF8.decode(bytes);
+ s = UTF8.decoder.convert(data, start, end);
}
return canonicalizedString(s, true);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698