Skip to content

Commit 9b15195

Browse files
scheglovcommit-bot@chromium.org
authored andcommitted
Inline CompialtionUnitElementImpl.getTypeFromTypes
R=brianwilkerson@google.com Change-Id: Ifa3386f19e69fd424f73a4f092438353709ae7e9 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123741 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
1 parent 7c6d212 commit 9b15195

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

pkg/analyzer/lib/src/dart/element/element.dart

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1662,7 +1662,12 @@ class CompilationUnitElementImpl extends UriReferencedElementImpl
16621662

16631663
@override
16641664
ClassElement getType(String className) {
1665-
return getTypeFromTypes(className, types);
1665+
for (ClassElement type in types) {
1666+
if (type.name == className) {
1667+
return type;
1668+
}
1669+
}
1670+
return null;
16661671
}
16671672

16681673
@override
@@ -1678,16 +1683,6 @@ class CompilationUnitElementImpl extends UriReferencedElementImpl
16781683
safelyVisitChildren(topLevelVariables, visitor);
16791684
}
16801685

1681-
static ClassElement getTypeFromTypes(
1682-
String className, List<ClassElement> types) {
1683-
for (ClassElement type in types) {
1684-
if (type.name == className) {
1685-
return type;
1686-
}
1687-
}
1688-
return null;
1689-
}
1690-
16911686
static void _createPropertiesAndAccessors(CompilationUnitElementImpl unit) {
16921687
if (unit._variables != null) return;
16931688
assert(unit._accessors == null);

0 commit comments

Comments
 (0)