MCPcopy Create free account
hub / github.com/ROCm/AMDMIGraphX / insert

Method insert

src/value.cpp:402–422  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

400}
401
402std::pair<value*, bool> value::insert(const value& v)
403{
404 if(v.key.empty())
405 {
406 if(not x)
407 x = std::make_shared<array_value_holder>();
408 get_array_impl(x).push_back(v);
409 assert(this->if_array());
410 return std::make_pair(&back(), true);
411 }
412 else
413 {
414 if(not x)
415 x = std::make_shared<object_value_holder>();
416 auto p = x->if_object()->emplace(v.key, get_array_impl(x).size());
417 if(p.second)
418 get_array_impl(x).push_back(v);
419 assert(this->if_object());
420 return std::make_pair(&get_array_impl(x)[p.first->second], p.second);
421 }
422}
423value* value::insert(const value* pos, const value& v)
424{
425 assert(v.key.empty());

Callers 15

add_op_nameFunction · 0.45
is_sortedFunction · 0.45
TEST_CASEFunction · 0.45
compile_moduleFunction · 0.45
read_stdinFunction · 0.45
compute_shapeMethod · 0.45
computeMethod · 0.45
TEST_CASEFunction · 0.45
add_pointwise_concatFunction · 0.45
TEST_CASEFunction · 0.45
mainFunction · 0.45
create_gqa_programFunction · 0.45

Calls 8

if_arrayMethod · 0.95
if_objectMethod · 0.95
beginFunction · 0.85
emplaceMethod · 0.80
emptyMethod · 0.45
push_backMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45

Tested by 12

is_sortedFunction · 0.36
TEST_CASEFunction · 0.36
read_stdinFunction · 0.36
compute_shapeMethod · 0.36
computeMethod · 0.36
TEST_CASEFunction · 0.36
create_gqa_programFunction · 0.36
add_dyn_scale_calcFunction · 0.36
test_invalid_inputFunction · 0.36
TEST_CASEFunction · 0.36
TEST_CASEFunction · 0.36
create_gqa_programFunction · 0.36