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

Unified Diff: pkg/analyzer/lib/src/dart/element/element.dart

Issue 2015513003: Optimize more megamorphic dispatch sites (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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: pkg/analyzer/lib/src/dart/element/element.dart
diff --git a/pkg/analyzer/lib/src/dart/element/element.dart b/pkg/analyzer/lib/src/dart/element/element.dart
index d46c864189b0b3cf1b6516337cd738da05af5e83..0ffc41ceb335f4960a1a82b391bad1a30a44e1a9 100644
--- a/pkg/analyzer/lib/src/dart/element/element.dart
+++ b/pkg/analyzer/lib/src/dart/element/element.dart
@@ -614,7 +614,9 @@ class ClassElementImpl extends ElementImpl
@override
PropertyAccessorElement getGetter(String getterName) {
- for (PropertyAccessorElement accessor in _accessors) {
+ int length = _accessors.length;
+ for (int i = 0; i < length; i++) {
+ PropertyAccessorElement accessor = _accessors[i];
if (accessor.isGetter && accessor.name == getterName) {
return accessor;
}
@@ -624,7 +626,9 @@ class ClassElementImpl extends ElementImpl
@override
MethodElement getMethod(String methodName) {
- for (MethodElement method in _methods) {
+ int length = _methods.length;
+ for (int i = 0; i < length; i++) {
+ MethodElement method = _methods[i];
if (method.name == methodName) {
return method;
}

Powered by Google App Engine
This is Rietveld 408576698