MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / removeIndex

Method removeIndex

json/jsoncpp.cpp:3701–3722  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3699}
3700
3701bool Value::removeIndex(ArrayIndex index, Value* removed) {
3702 if (type_ != arrayValue) {
3703 return false;
3704 }
3705 CZString key(index);
3706 ObjectValues::iterator it = value_.map_->find(key);
3707 if (it == value_.map_->end()) {
3708 return false;
3709 }
3710 *removed = it->second;
3711 ArrayIndex oldSize = size();
3712 // shift left all items left, into the place of the "removed"
3713 for (ArrayIndex i = index; i < (oldSize - 1); ++i) {
3714 CZString keey(i);
3715 (*value_.map_)[keey] = (*this)[i + 1];
3716 }
3717 // erase the last one ("leftover")
3718 CZString keyLast(oldSize - 1);
3719 ObjectValues::iterator itLast = value_.map_->find(keyLast);
3720 value_.map_->erase(itLast);
3721 return true;
3722}
3723
3724#ifdef JSON_USE_CPPTL
3725Value Value::get(const CppTL::ConstString& key,

Callers

nothing calls this directly

Calls 4

findMethod · 0.80
eraseMethod · 0.80
sizeFunction · 0.50
endMethod · 0.45

Tested by

no test coverage detected