Fix Issue 24541 - cartesianProduct should have a length for finite ranges
This Draft PR aims to address issue #9871 (Issue 24541 on BugZilla). As of now, I have added a length field to the cartesianProduct implementation with two finite forward ranges. Since I've already built the unittests for it I'm publishing this Draft PR in case anyone wants to give some feedback. I'm still working on the case of two finite ranges where one of them is not a forward range, particularly to replace the joiner returned in cartesianProduct with a sized range.
Changelog as of now:
- Modified the
Resultstruct insidecartesianProductto include alengthfield. - Added checks on
lengthinunittestregardingcartesianProductwith finite forward ranges. - Added a
unittestto ensure the correct calculation oflengthwhen popping elements.
Thanks for your pull request and interest in making D better, @nicolo-mn! We are looking forward to reviewing it, and you should be hearing from a maintainer soon. Please verify that your PR follows this checklist:
- My PR is fully covered with tests (you can see the coverage diff by visiting the details link of the codecov check)
- My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
- I have provided a detailed rationale explaining my changes
- New or modified functions have Ddoc comments (with
Params:andReturns:)
Please see CONTRIBUTING.md for more information.
If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.
Bugzilla references
Your PR doesn't reference any Bugzilla issue.
If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.
Testing this PR locally
If you don't have a local development environment setup, you can use Digger to test this PR:
dub run digger -- build "master + phobos#10657"
length field in cartesianProduct with one finite input range and one finite forward range has been added
@thewilsonator Could you check my changes when you got some time? Thanks in advance!