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

Unified Diff: pkg/compiler/lib/src/types/union_type_mask.dart

Issue 1627333002: Optimize subclass/subtype queries (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Cleanup Created 4 years, 11 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/compiler/lib/src/types/union_type_mask.dart
diff --git a/pkg/compiler/lib/src/types/union_type_mask.dart b/pkg/compiler/lib/src/types/union_type_mask.dart
index 24a019144a87e3d76477db32517f90d80fc4f17a..a30cdb2a97fbf7d3ef099e3f1bc6fcdb54359810 100644
--- a/pkg/compiler/lib/src/types/union_type_mask.dart
+++ b/pkg/compiler/lib/src/types/union_type_mask.dart
@@ -118,7 +118,7 @@ class UnionTypeMask implements TypeMask {
// TODO(sigmund, johnniwinther): computing length here (and below) is
// expensive. If we can't prevent `flatten` from being called a lot, it
// might be worth caching results.
- size = classWorld.strictSubclassesOf(candidate).length;
+ size = classWorld.strictSubclassCount(candidate);
assert(size <= classWorld.strictSubtypesOf(candidate).length);
} else {
kind = FlatTypeMask.SUBTYPE;

Powered by Google App Engine
This is Rietveld 408576698