Closed GreasySlug closed 1 year ago
In general, element traversal is most efficient with a for statement. This is because it allows optimization for boundary checks. This is also true when using VecDeque.
Okay, this PR was meant to be a discussion, so, I'll close it
This implementation is incorrect. Because
.iter().next_back()
always returns the same element. Also,VecDeque
's reverse iterator usesnext_back()
internally, so there is no need to change the iteration part.