Skip to content

fix: avoid extra nil entries in value projection results#100

Open
SAY-5 wants to merge 1 commit into
jmespath:masterfrom
SAY-5:fix-value-projection-nulls
Open

fix: avoid extra nil entries in value projection results#100
SAY-5 wants to merge 1 commit into
jmespath:masterfrom
SAY-5:fix-value-projection-nulls

Conversation

@SAY-5
Copy link
Copy Markdown

@SAY-5 SAY-5 commented May 12, 2026

The value projection (*) preallocated its working slice with make([]interface{}, len(mapType)) and then appended to it, producing a slice twice the expected size whose first half was all nil. This propagated through downstream expressions like *.to_string(@). Allocating with zero length and the map size as capacity fixes it.

Closes #84

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.

Probable bug: mysterious nulls from wildcard expression

1 participant