json icon indicating copy to clipboard operation
json copied to clipboard

object::stable_insert

Open gummif opened this issue 3 years ago • 3 comments

This is for inserting values at any position in the object preserving order of all elements (at the cost of linear complexity). Part 2/2 of https://github.com/boostorg/json/issues/748.

This does not have the bug https://github.com/boostorg/json/issues/763 since care is taken to avoid allocation unless necessary.

gummif avatar Oct 11 '22 21:10 gummif

Codecov Report

Merging #765 (d854374) into develop (ce144b5) will decrease coverage by 0.16%. The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #765      +/-   ##
===========================================
- Coverage    99.13%   98.97%   -0.17%     
===========================================
  Files           69       69              
  Lines         6587     6623      +36     
===========================================
+ Hits          6530     6555      +25     
- Misses          57       68      +11     
Impacted Files Coverage Δ
include/boost/json/object.hpp 100.00% <ø> (ø)
include/boost/json/impl/object.hpp 100.00% <100.00%> (ø)
include/boost/json/impl/object.ipp 100.00% <100.00%> (ø)
include/boost/json/basic_parser_impl.hpp 98.33% <0.00%> (-0.88%) :arrow_down:
include/boost/json/detail/config.hpp 100.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update ce144b5...d854374. Read the comment docs.

codecov[bot] avatar Oct 11 '22 21:10 codecov[bot]

One thing that could reduce duplication is to implement insert in terms of stable_insert_impl using pos as end().

gummif avatar Oct 12 '22 20:10 gummif