Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[flutter_test] find.ancestor() is slow #108920

Closed
@passsy

Description

@passsy

I noticed that find.ancestor() is quite slow. It seems like evaluate() is called too often.

@override
Iterable<Element> apply(Iterable<Element> candidates) {
return candidates.where((Element element) => ancestor.evaluate().contains(element));
}

Possible fix:
Call ancestor.evaluate() only once at the beginning of the method instead of every time for every child.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions