FrameRange : Prevent creation of FrameRanges with negative steps #1372
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously, you could create a FrameRange object with a negative step, but it would go into an infinite loop if you tried to get the frame list
Given that we have the ReversedFrameList that achieves the same as a negative step, it felt like using that was the correct approach.
Note that we still include the support for the negative step in the parse method, so that we can provide a more useful error message during init.
Generally describe what this PR will do, and why it is needed.
Related Issues
Creating a FrameRange object with a negative frame range would cause an infinite loop when trying to fetch the list of frames.
Dependencies
None.
Breaking Changes
Negative steps were already not supported, since they caused the infinite loop.
Checklist