Skip to content

Fix deletion using assigning empty against arrays#2133

Merged
nicowilliams merged 2 commits intojqlang:masterfrom
itchyny:fix-modify-array-empty
Jul 8, 2023
Merged

Fix deletion using assigning empty against arrays#2133
nicowilliams merged 2 commits intojqlang:masterfrom
itchyny:fix-modify-array-empty

Conversation

@itchyny
Copy link
Contributor

@itchyny itchyny commented May 29, 2020

This pull request fixes #2051, by delaying path deletions. Also fixes #2397, fixes #2422 and fixes #2440.

 % ./jq -c '(.[] | select(. >= 2)) |= empty' <<< '[1,5,3,0,7]'
[1,0]
 % ./jq -c '.[] |= select(. >= 4)' <<< '[1,5,3,0,7]'
[5,7]
 % ./jq -c '.[] |= select(. == 2)' <<< '[1,5,3,0,7]'
[]

@itchyny itchyny force-pushed the fix-modify-array-empty branch from 5723780 to f0551fa Compare May 29, 2020 08:25
@coveralls
Copy link

coveralls commented May 29, 2020

Coverage Status

Coverage remained the same at 84.134% when pulling d452f7d on itchyny:fix-modify-array-empty into 6306ac8 on stedolan:master.

@itchyny itchyny force-pushed the fix-modify-array-empty branch 2 times, most recently from 6ba3fa6 to d452f7d Compare May 29, 2020 09:06
@itchyny itchyny force-pushed the fix-modify-array-empty branch from d452f7d to 5e5a287 Compare November 3, 2021 03:31
@itchyny itchyny added the bug label Jun 3, 2023
@itchyny itchyny mentioned this pull request Jul 6, 2023
4 tasks
@itchyny itchyny force-pushed the fix-modify-array-empty branch from 5e5a287 to 559b737 Compare July 6, 2023 23:12
@itchyny itchyny added this to the 1.7 release milestone Jul 6, 2023
@itchyny itchyny force-pushed the fix-modify-array-empty branch 2 times, most recently from 3eca0e4 to 4b09f73 Compare July 7, 2023 04:53
@itchyny itchyny force-pushed the fix-modify-array-empty branch from 4b09f73 to e3defc0 Compare July 7, 2023 04:54
@nicowilliams nicowilliams merged commit af57893 into jqlang:master Jul 8, 2023
@nicowilliams
Copy link
Contributor

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

3 participants