Skip to content

Conversation

@stephenmk
Copy link
Contributor

@stephenmk stephenmk commented Dec 19, 2025

Description

This pull request adds an optimization to PatchExtensions.PatchForArray. When generating a patch in which an array from the original node contains 0 items and the corresponding target array contains N items, N > 0, then then the output patch should contain 1 Replace operation instead of N Add operations.

Links

Resolves #964
Relates to #963 (also modifies this class method)

Checks

@gregsdennis
Copy link
Collaborator

gregsdennis commented Dec 19, 2025

@stephenmk since you have two PRs open for Patch, please bump the patch version and add an entry in the release notes on one of them, then I'll merge them so that it publishes the new version.

@stephenmk
Copy link
Contributor Author

@gregsdennis Added

@gregsdennis gregsdennis merged commit e29cf8b into json-everything:master Dec 21, 2025
6 checks passed
@stephenmk stephenmk deleted the issue-964 branch December 22, 2025 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PatchExtensions.PatchForArray can produce shorter patches when original array is empty

2 participants