Skip to content
This repository was archived by the owner on Sep 20, 2021. It is now read-only.
This repository was archived by the owner on Sep 20, 2021. It is now read-only.

Import Rust iterator methods into this library #32

Description

@Hywan

For instance:

$any = (new Iterator\Map($data)).any(function ($item) { return 0 === $item % 2; })

instead of:

$any = false;

foreach ($data as $datum) {
    if (0 === $item % 2) {
        $any = true;

        break;
    }
}

The first is less error-prone, normally bug-free, and easier to read. We can optimise it a lot too.

See the Rust iterator API: https://doc.rust-lang.org/std/iter/trait.Iterator.html.
We should benchmark results with manual implementation vs. iterator_apply.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions