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

Unified Diff: sdk/lib/_internal/compiler/implementation/mirrors/dart2js_type_mirrors.dart

Issue 177963002: Use List instead of Link in the type system. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 6 years, 6 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/_internal/compiler/implementation/mirrors/dart2js_type_mirrors.dart
diff --git a/sdk/lib/_internal/compiler/implementation/mirrors/dart2js_type_mirrors.dart b/sdk/lib/_internal/compiler/implementation/mirrors/dart2js_type_mirrors.dart
index 4a3bfe735f7117d939f1e29a944c3c68f3706cc4..e93400c4a3cd58491d147ac6f9d6eb80517b1d53 100644
--- a/sdk/lib/_internal/compiler/implementation/mirrors/dart2js_type_mirrors.dart
+++ b/sdk/lib/_internal/compiler/implementation/mirrors/dart2js_type_mirrors.dart
@@ -112,10 +112,8 @@ abstract class Dart2JsGenericTypeMirror extends Dart2JsTypeElementMirror {
if (_typeArguments == null) {
_typeArguments = <TypeMirror>[];
if (!_type.isRaw) {
- Link<DartType> type = _type.typeArguments;
- while (type != null && type.head != null) {
- _typeArguments.add(_getTypeMirror(type.head));
- type = type.tail;
+ for (DartType type in _type.typeArguments) {
+ _typeArguments.add(_getTypeMirror(type));
}
}
}
@@ -157,20 +155,20 @@ abstract class Dart2JsGenericTypeMirror extends Dart2JsTypeElementMirror {
'with ${newTypeArguments.length} arguments, '
'expect ${typeVariables.length} arguments.');
}
- LinkBuilder<DartType> builder = new LinkBuilder<DartType>();
+ List<DartType> builder = <DartType>[];
for (TypeSourceMirror newTypeArgument in newTypeArguments) {
if (newTypeArgument.isVoid) {
throw new ArgumentError('Cannot use void as type argument.');
}
if (newTypeArgument is Dart2JsTypeMirror) {
- builder.addLast(newTypeArgument._type);
+ builder.add(newTypeArgument._type);
} else {
throw new UnsupportedError(
'Cannot create instantiation using a type '
'mirror from a different mirrorSystem implementation.');
}
}
- return owner._getTypeMirror(_type.createInstantiation(builder.toLink()));
+ return owner._getTypeMirror(_type.createInstantiation(builder));
}
}

Powered by Google App Engine
This is Rietveld 408576698