Skip to content

Commit c3e7170

Browse files
scheglovCommit Queue
authored andcommitted
Elements. Cache interfaces in InheritanceManager3 by InterfaceElementImpl.
Change-Id: I570f2a78b8619978aff6994c61f2860455a780ba Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/438482 Reviewed-by: Paul Berry <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]>
1 parent 6e6ce7c commit c3e7170

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ class InheritanceManager3 {
6363
MethodElement.NO_SUCH_METHOD_METHOD_NAME,
6464
);
6565

66-
/// Cached instance interfaces for [InterfaceFragmentImpl].
67-
final Map<InterfaceFragmentImpl, Interface> _interfaces = {};
66+
/// Cached instance interfaces for [InterfaceElementImpl].
67+
final Map<InterfaceElementImpl, Interface> _interfaces = {};
6868

6969
/// Tracks signatures from superinterfaces that were combined.
7070
/// It is used to track dependencies in manifests.
@@ -276,7 +276,7 @@ class InheritanceManager3 {
276276
/// Remove interfaces for classes defined in specified libraries.
277277
void removeOfLibraries(Set<Uri> uriSet) {
278278
_interfaces.removeWhere((element, _) {
279-
return uriSet.contains(element.librarySource.uri);
279+
return uriSet.contains(element.library.uri);
280280
});
281281
}
282282

@@ -454,11 +454,11 @@ class InheritanceManager3 {
454454
/// Implementation of [getInterface], without dependency tracking.
455455
Interface _getInterface(InterfaceElement element) {
456456
element as InterfaceElementImpl; // TODO(scheglov): remove cast
457-
var result = _interfaces[element.firstFragment];
457+
var result = _interfaces[element];
458458
if (result != null) {
459459
return result;
460460
}
461-
_interfaces[element.firstFragment] = Interface._empty;
461+
_interfaces[element] = Interface._empty;
462462

463463
if (!_processingClasses.add(element.firstFragment)) {
464464
return Interface._empty;
@@ -476,7 +476,7 @@ class InheritanceManager3 {
476476
_processingClasses.remove(element.firstFragment);
477477
}
478478

479-
_interfaces[element.firstFragment] = result;
479+
_interfaces[element] = result;
480480
return result;
481481
}
482482

0 commit comments

Comments
 (0)