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

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

Issue 12328104: Change new List(n) to return fixed length list. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merge to head. Created 7 years, 10 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/utf/utf8.dart
diff --git a/sdk/lib/utf/utf8.dart b/sdk/lib/utf/utf8.dart
index 4bf216f8095ea5b657e82409b523a2b08546523a..b44cbe4e5cf9d9f5701034b1524acdb31f0101ad 100644
--- a/sdk/lib/utf/utf8.dart
+++ b/sdk/lib/utf/utf8.dart
@@ -86,7 +86,7 @@ List<int> codepointsToUtf8(
}
}
- List<int> encoded = new List<int>.fixedLength(encodedLength);
+ List<int> encoded = new List<int>(encodedLength);
int insertAt = 0;
for (int value in source) {
if (value < 0 || value > UNICODE_VALID_RANGE_MAX) {
@@ -173,7 +173,7 @@ class Utf8Decoder implements Iterator<int> {
* into a [List<int>].
*/
List<int> decodeRest() {
- List<int> codepoints = new List<int>.fixedLength(utf8EncodedBytesIterator.remaining);
+ List<int> codepoints = new List<int>(utf8EncodedBytesIterator.remaining);
int i = 0;
while (moveNext()) {
codepoints[i++] = current;
@@ -181,7 +181,7 @@ class Utf8Decoder implements Iterator<int> {
if (i == codepoints.length) {
return codepoints;
} else {
- List<int> truncCodepoints = new List<int>.fixedLength(i);
+ List<int> truncCodepoints = new List<int>(i);
truncCodepoints.setRange(0, i, codepoints);
return truncCodepoints;
}

Powered by Google App Engine
This is Rietveld 408576698