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

Unified Diff: lib/binary/ast_from_binary.dart

Issue 2502343002: Store named parameters in sorted lists instead of using maps. (Closed)
Patch Set: Remove duplicates from named parameter lists to recover from erroneous inputs Created 4 years, 1 month 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 | « lib/ast.dart ('k') | lib/binary/ast_to_binary.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/binary/ast_from_binary.dart
diff --git a/lib/binary/ast_from_binary.dart b/lib/binary/ast_from_binary.dart
index bbad877591cf1b1e3a6bb434a5f6e64d7c7c3eba..1b228b80d8c6c37596bff46c4b338f72f2159778 100644
--- a/lib/binary/ast_from_binary.dart
+++ b/lib/binary/ast_from_binary.dart
@@ -816,6 +816,14 @@ class BinaryBuilder {
return new List<DartType>.generate(readUInt(), (i) => readDartType());
}
+ List<NamedType> readNamedTypeList() {
+ return new List<NamedType>.generate(readUInt(), (i) => readNamedType());
+ }
+
+ NamedType readNamedType() {
+ return new NamedType(readStringReference(), readDartType());
+ }
+
DartType readDartTypeOption() {
return readAndCheckOptionTag() ? readDartType() : null;
}
@@ -840,13 +848,7 @@ class BinaryBuilder {
var typeParameters = readAndPushTypeParameterList();
var requiredParameterCount = readUInt();
var positional = readDartTypeList();
- int namedParameterCount = readUInt();
- var named = <String, DartType>{};
- for (int i = 0; i < namedParameterCount; ++i) {
- var name = readStringReference();
- var type = readDartType();
- named[name] = type;
- }
+ var named = readNamedTypeList();
var returnType = readDartType();
typeParameterStack.length = typeParameterStackHeight;
return new FunctionType(positional, returnType,
« no previous file with comments | « lib/ast.dart ('k') | lib/binary/ast_to_binary.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698