JSON: Eliminate extra copies in Object#5029
Merged
aleks-f merged 4 commits intopocoproject:mainfrom Dec 9, 2025
Merged
Conversation
Contributor
Author
|
The builds failed due to a null pointer exception in one of the unit tests. I don't have time to look into why, but if someone else wants to take a look, please feel free to! |
Header file (JSON/include/Poco/JSON/Object.h): Replaced single _modified flag with two separate flags: _structModified and _ordStructModified Updated remove() inline function to set both flags Implementation file (JSON/src/Object.cpp): Updated all constructors and assignment operators to use both flags Copy constructor now properly copies both _pStruct and _pOrdStruct based on their respective modified flags operator const DynamicStruct&() now uses _structModified operator const OrderedDynamicStruct&() now uses _ordStructModified set() and clear() methods set both flags to true
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I didn't create an associated issue for this. I just discovered this minor problem while reviewing the Poco code. The identical code in JSON::Array sets
_modifiedtofalse, so I think it should do the same in JSON::Object.