Skip to content

Feature: add function to deep copy a node from one decoder to a node from another #22

@HeadHunter483

Description

@HeadHunter483

Sometimes there is a need in creating a copy of JSON node subtree to another independent node to perform transformations. For this purpose it would be great to have a function to deep copy the whole data of one node to another node. There is a MutateToNode function which can do something familiar to copy, but it assigns pointers to nodes which can cause unplanned mutations. Also, when a node from one decoder is copied to a node from another via MutateToNode, if the fist node is released, its decoder is returned to pool and is prepared to be collected by GC, it might not be freed because the pointers to nodes from its pool are used in a node from another decoder and it can lead to memory leaks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions