mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 16:41:07 +00:00
Use for-each statement, not 'forEach' method.
When running flutter_elements benchmark. Timings in ms, for 'Compute benchmark results' that does filtering. JIT forEach: 549 530 546 for-each statement: 360 353 326 AOT forEach: 419 410 425 for-each statement: 277 272 270 Change-Id: I5a38b9f7fef022327d6369089dcc8190508ffa24 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330983 Commit-Queue: Konstantin Shcheglov <scheglov@google.com> Reviewed-by: Martin Kustermann <kustermann@google.com>
This commit is contained in:
parent
1dc0eb05ea
commit
0ce6ee3b3f
|
@ -4,7 +4,6 @@
|
|||
|
||||
// ignore_for_file: annotate_overrides
|
||||
// ignore_for_file: avoid_init_to_null
|
||||
// ignore_for_file: avoid_function_literals_in_foreach_calls
|
||||
// ignore_for_file: empty_constructor_bodies
|
||||
// ignore_for_file: prefer_is_not_empty
|
||||
// ignore_for_file: unnecessary_brace_in_string_interps
|
||||
|
@ -490,11 +489,11 @@ class Analysis {
|
|||
IntSet filter(IntSet objectIds, bool Function(HeapSnapshotObject) filter) {
|
||||
final result = IntSet();
|
||||
final objects = graph.objects;
|
||||
objectIds.forEach((int objId) {
|
||||
for (final objId in objectIds) {
|
||||
if (filter(objects[objId])) {
|
||||
result.add(objId);
|
||||
}
|
||||
});
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue