open-source-parsers / jsoncpp

A C++ library for interacting with JSON.
Other
8.06k stars 2.63k forks source link

Move removeIndex's result instead of copying #1516

Open jedav opened 10 months ago

jedav commented 10 months ago

Currently removeIndex copies the removed value into removed and then destructs the original, which can cause significant performance costs when removing a large tree by index. This change causes removeIndex to std::move the removed value into removed instead, avoiding this copy and destruction overhead. removeMember already moves its result in this way.