Skip to content

Change range_rev to be inclusive on the low end #5270

Closed
@sanxiyn

Description

@sanxiyn

Currently range_rev(hi, lo) iterates [hi..lo), but it probably should iterate (hi..lo].

For example, consider iterating indexes of vector of length 10 from the end. Currently that is range_rev(10-1, -1), but since hi and lo should be the same type, this can't be uint, and to be used as an index it needs to be cast. range_rev(10, 0) would be better.

This is from the mailing list discussion.

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