Skip to content

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

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

schleppy
Copy link

@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
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

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.

2 participants