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

Unified Diff: pkg/analyzer/lib/src/generated/resolver.dart

Issue 996053003: Use Map.addAll() where possible in the resolver. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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/analyzer/lib/src/generated/resolver.dart
diff --git a/pkg/analyzer/lib/src/generated/resolver.dart b/pkg/analyzer/lib/src/generated/resolver.dart
index 315253b35ecb08df414b4369412dd3683888295b..a98b97f8190a97ed950a16f5c47525be612d36d6 100644
--- a/pkg/analyzer/lib/src/generated/resolver.dart
+++ b/pkg/analyzer/lib/src/generated/resolver.dart
@@ -9361,9 +9361,7 @@ class NamespaceBuilder {
*/
void _addAllFromMap(
Brian Wilkerson 2015/03/12 18:59:44 Shouldn't we just get rid of this helper method?
Map<String, Element> definedNames, Map<String, Element> newNames) {
- newNames.forEach((String name, Element element) {
- definedNames[name] = element;
- });
+ definedNames.addAll(newNames);
}
/**
@@ -9375,7 +9373,7 @@ class NamespaceBuilder {
void _addAllFromNamespace(
Map<String, Element> definedNames, Namespace namespace) {
if (namespace != null) {
- _addAllFromMap(definedNames, namespace.definedNames);
+ definedNames.addAll(namespace.definedNames);
}
}
@@ -12899,9 +12897,7 @@ class TypeOverrideManager_TypeOverrideScope {
* @param overrides the overrides to be applied
*/
void applyOverrides(Map<VariableElement, DartType> overrides) {
- overrides.forEach((VariableElement element, DartType type) {
- _overridenTypes[element] = type;
- });
+ _overridenTypes.addAll(overrides);
}
/**
« 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