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

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

Issue 952913003: Use direct lookup rather than iteration (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 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
« 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/error_verifier.dart
diff --git a/pkg/analyzer/lib/src/generated/error_verifier.dart b/pkg/analyzer/lib/src/generated/error_verifier.dart
index 06026b3bd6aace1a7818c363a6f66108ea653f25..bf32a2ae822d8ca34daaa1981d714f7795b16cb4 100644
--- a/pkg/analyzer/lib/src/generated/error_verifier.dart
+++ b/pkg/analyzer/lib/src/generated/error_verifier.dart
@@ -3813,12 +3813,8 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> {
visitedClasses.add(superclassElement);
LibraryElement superclassLibrary = superclassElement.library;
// Check fields.
- List<FieldElement> fieldElts = superclassElement.fields;
- for (FieldElement fieldElt in fieldElts) {
- // We need the same name.
- if (fieldElt.name != executableElementName) {
- continue;
- }
+ FieldElement fieldElt = superclassElement.getField(executableElementName);
+ if (fieldElt != null) {
// Ignore if private in a different library - cannot collide.
if (executableElementPrivate &&
_currentLibrary != superclassLibrary) {
@@ -4587,16 +4583,14 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> {
//
// Store in local sets the set of all method and accessor names
//
- List<MethodElement> methods = _enclosingClass.methods;
- for (MethodElement method in methods) {
- String methodName = method.name;
+ MethodElement method =
+ _enclosingClass.getMethod(FunctionElement.NO_SUCH_METHOD_METHOD_NAME);
+ if (method != null) {
// If the enclosing class declares the method noSuchMethod(), then return.
// From Spec: It is a static warning if a concrete class does not have an
// implementation for a method in any of its superinterfaces unless it
// declares its own noSuchMethod method (7.10).
- if (methodName == FunctionElement.NO_SUCH_METHOD_METHOD_NAME) {
- return false;
- }
+ return false;
}
HashSet<ExecutableElement> missingOverrides =
new HashSet<ExecutableElement>();
« 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