Index: pkg/compiler/lib/src/inferrer/node_tracer.dart |
diff --git a/pkg/compiler/lib/src/inferrer/node_tracer.dart b/pkg/compiler/lib/src/inferrer/node_tracer.dart |
index 058d36ddc5cc33664930350ede385f1f4f459035..72c696544da8b226e23a4ab927b424aa5731a951 100644 |
--- a/pkg/compiler/lib/src/inferrer/node_tracer.dart |
+++ b/pkg/compiler/lib/src/inferrer/node_tracer.dart |
@@ -113,10 +113,14 @@ abstract class TracerVisitor<T extends TypeInformation> |
bool _wouldBeTooManyUsers(Set users) { |
int seenSoFar = analyzedElements.length; |
if (seenSoFar + users.length <= MAX_ANALYSIS_COUNT) return false; |
- int actualWork = users |
- .where((TypeInformation user) => !analyzedElements.contains(user.owner)) |
- .length; |
- return seenSoFar + actualWork > MAX_ANALYSIS_COUNT; |
+ int actualWork = 0; |
+ for (TypeInformation user in users) { |
+ if (!analyzedElements.contains(user.owner)) { |
+ actualWork++; |
+ if (actualWork > MAX_ANALYSIS_COUNT - seenSoFar) return true; |
+ } |
+ } |
+ return false; |
} |
void analyze() { |