[range.slide.view] Replace conditional with call to max
Open
Nobody has claimed this yet.
P3-Other
- Dominant language
- TeX
- Stars
- 221
- Forks
- 813
- Avg merge
- 16h 4m
- Merged PRs (30d)
- 36
Description
[range.slide.view] adds (via #5249)
auto sz = ranges::distance(base_) - n_ + 1;
if (sz < 0) sz = 0;
return to-unsigned-like(sz);
Which can be simplified to
auto sz = max({}, ranges::distance(base_) - n_ + 1);
return to-unsigned-like(sz);
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the range.slide.view wording and the change introduced via #5249. Replace the shown conditional size clamp with the max-based expression, then verify that the resulting draft text matches the requested simplification.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- documentation
- Issue type
- Refactor
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100