Changes needed for ReJSON multi values and multi paths #477#18
Changes needed for ReJSON multi values and multi paths #477#18oshadmi merged 6 commits intogeneric_json_pathfrom
Conversation
| } | ||
|
|
||
| //No path was computed for missing targets | ||
| result.clear(); |
There was a problem hiding this comment.
If some value, initially in the result vector, is not visited by _walk and not removed by retain, and does not have a corresponding path in the return value, we also don't want it in the final result (and we also want both returned vectors to have the same length)
This could happen if such an initial value is not a descendant of any node of self.
Actually compute_paths is not a public, so we can assume it should not happen,
So I can remove the clear
There was a problem hiding this comment.
If it can not happen we can assert it no?
MeirShpilraien
left a comment
There was a problem hiding this comment.
Small question, by the way, I think it's OK to clone the result vector instead of doing this trick, after all, you are basically doing what clone would have done, no?
Actually, this is required for the sake of getting the returned paths aligned with the returned values, so they have corresponding positions in each vector. Otherwise, the initial order of the |
This reverts commit 4b11540. Decided this api does not pertain to this trait
Needed for ReJSON multi values and multi paths #477
This change is needed to also get the values, in addition to the paths, from
compute_paths