Skip to content

Fix the find filter to return nil when filtering empty arrays#1902

Merged
karreiro merged 2 commits intomainfrom
find-filter-patch
Jan 24, 2025
Merged

Fix the find filter to return nil when filtering empty arrays#1902
karreiro merged 2 commits intomainfrom
find-filter-patch

Conversation

@karreiro
Copy link
Contributor

This PR is a patch that addresses an issue in the find filter introduced by #1869.

When filtering an empty array, the find filter should return nil, just as it returns the found element when it locates the desired element or nil when the element cannot be found. However, it was incorrectly returning an empty array.

@karreiro karreiro requested a review from a team January 23, 2025 10:11
Copy link

@frandiox frandiox left a comment

Choose a reason for hiding this comment

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

Code looks good 👍 -- What about find_index, though?

@karreiro
Copy link
Contributor Author

Thanks a lot for the review, @frandiox! I've applied the fixes for find_index and has as well :)

@karreiro karreiro merged commit bf1419b into main Jan 24, 2025
13 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.

4 participants