Skip to content

Rename Iterators invert() method to something shorter, like flip() #10632

Closed
@Kimundi

Description

@Kimundi

The docs for it already read as "Flip the direction of the iterator", and it's a shorter name.

The length, at the very least, becomes important if we decide to do something like #9391, because then using invert would become the common way to iterater over values in reverse. Compare:

for c in "abc".chars().invert() {
    // c, b, a
}
for c in "abc".chars().flip() {
    // c, b, a
}

Imo, the meaning also becomes marginally more clear that way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions