Skip to content

random: Remove redundant assignments in php_random_rangeX() #14536

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 11, 2024

Conversation

jorgsowa
Copy link
Contributor

Found 2 redundant assignments in random.c + missing commas in comments.

@jorgsowa jorgsowa requested a review from TimWolla June 11, 2024 18:14
@TimWolla TimWolla changed the title Remove redundant assignments in random.c random: Remove redundant assignments in php_random_rangeX() Jun 11, 2024
@jorgsowa
Copy link
Contributor Author

@TimWolla thanks for the suggestions. Although, I don't get the point:

By keeping the declaration separate the loop at the top can simply be copy-and-pasted without needing to remove the type declaration.

Why do you need to copy and paste this part?

@jorgsowa jorgsowa requested a review from TimWolla June 11, 2024 19:12
@TimWolla
Copy link
Member

Why do you need to copy and paste this part?

While I expect the implementation of these loops to remain stable for the foreseeable future, in case of necessary changes (such as ab5491f), the changes would need to be applied to both loops identically. It's easier to simply copy-and-paste them, instead of manually performing the identical change in both locations.

@TimWolla TimWolla merged commit 45714e2 into php:master Jun 11, 2024
10 of 11 checks passed
@jorgsowa jorgsowa deleted the random/remove-redundant-assignments branch June 13, 2024 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants