Skip to content

IterRange can never include the last (Max) element #2

@peterbourgon

Description

@peterbourgon

I want to iterate from a given key to the end of the tree inclusively. But there seems to be no way to get the last (tree.Max()) value as part of that iteration. I don't know what the most elegant solution would be...

  • a bool param to IterRange that would change < @upper to <= @upper?
  • a new IterRangeInclusive that goes @lower <= E <= @upper?
  • telling me I should simply tack on tree.Max() when my IterRange chan returns a nil and I expect another element?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions