Skip to content

Support reverse for ListView #18350

@brancz

Description

@brancz

Is your feature request related to a problem or challenge?

ListView, as opposed to List, is not supported by the reverse function, yet.

Describe the solution you'd like

Unless I'm misunderstanding the ListView spec, I think this should be possible by performing offset + size - 1 to compute the new offsets and just size * -1.

Hopefully, downstream usages use iterators and not regular for loops that assume strictly increasing indexes, but I'd call that a bug if they didn't.

Describe alternatives you've considered

Cast to List instead, however, based on some profiling we've done in the other direction (converting List to ListView), this is a terrible idea.

Additional context

No response

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions