MCPcopy Create free account
hub / github.com/couchbase/fleece / getMutable

Method getMutable

Fleece/Mutable/HeapArray.cc:93–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91
92
93 HeapCollection* HeapArray::getMutable(uint32_t index, tags ifType) {
94 if (index >= count())
95 return nullptr;
96 Retained<HeapCollection> result = nullptr;
97 auto &mval = _items[index];
98 if (mval) {
99 result = mval.makeMutable(ifType);
100 } else if (_source) {
101 result = HeapCollection::mutableCopy(_source->get(index), ifType);
102 if (result)
103 _items[index].set(result->asValue());
104 }
105 if (result)
106 setChanged(true);
107 return result;
108 }
109
110 MutableArray* HeapArray::getMutableArray(uint32_t i) {
111 return (MutableArray*)asValue(getMutable(i, internal::kArrayTag));

Callers

nothing calls this directly

Calls 4

makeMutableMethod · 0.80
getMethod · 0.45
setMethod · 0.45
asValueMethod · 0.45

Tested by

no test coverage detected