Skip to content

fix: Object.ForEach now continues the loop after consuming a skipped value#92

Merged
harshavardhana merged 1 commit intominio:masterfrom
schleppy:fix-object-foreach-usekeys
Jun 16, 2025
Merged

fix: Object.ForEach now continues the loop after consuming a skipped value#92
harshavardhana merged 1 commit intominio:masterfrom
schleppy:fix-object-foreach-usekeys

Conversation

@schleppy
Copy link
Copy Markdown
Contributor

@schleppy schleppy commented Apr 1, 2025

This pull request fixes an issue in Object.ForEach that occurs when a non-nil onlyKeys map is provided. Specifically, if the current key isn't found in the map, the code correctly skips over its associated value but then fails to continue to the next iteration. As a result, the remainder of the loop runs and mistakenly consumes the subsequent key. This update ensures that the loop properly skips the rest of the current iteration when a key is absent.

Copy link
Copy Markdown
Collaborator

@klauspost klauspost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@harshavardhana harshavardhana merged commit cac9cd1 into minio:master Jun 16, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants