Skip to content

fix: use ipairs in functional.all and add basic test coverage#659

Open
DavidAtBede wants to merge 1 commit intonvim-lua:masterfrom
DavidAtBede:fix-iteration-in-functional-all
Open

fix: use ipairs in functional.all and add basic test coverage#659
DavidAtBede wants to merge 1 commit intonvim-lua:masterfrom
DavidAtBede:fix-iteration-in-functional-all

Conversation

@DavidAtBede
Copy link

fix(functional): use ipairs in all to avoid incorrect iteration over tables

Previously, functional.all used pairs, which can iterate non-numeric keys
and lead to incorrect behavior when passed list-style tables.

This patch switches to ipairs, preserving the existing (k, v) arity of the
predicate function but ensuring predictable, index-ordered traversal.

Added test coverage for all, including cases for full match, partial failure,
and empty input.

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.

1 participant