Skip to content
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

Fix invalid platform removal missing adjacent platforms #7170

Merged
merged 1 commit into from Nov 21, 2023

Conversation

Bo98
Copy link
Contributor

@Bo98 Bo98 commented Nov 17, 2023

What was the end-user or developer problem that led to this PR?

When researching #7169, I noticed if you had multiple invalid platforms then not all will be removed if they are located on adjacent lines. This is because we were modifying the array while iterating over it.

What is your fix for the problem, implemented in this PR?

The fix is to iterate in reverse order, so we are not shifting things we've not yet reached.

The existing test was modified to include two invalid platforms rather than just one, which should in theory cover this bug.

Make sure the following tasks are checked

@deivid-rodriguez
Copy link
Member

Thanks for the fix!

@deivid-rodriguez deivid-rodriguez merged commit 8c0c3b6 into rubygems:master Nov 21, 2023
66 checks passed
@Bo98 Bo98 deleted the platform-removal-fix branch November 21, 2023 19:11
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.

None yet

2 participants