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

Method remove

Fleece/Integration/MArray.hh:110–124  ·  view source on GitHub ↗

Removes `n` values starting at index `i`, or returns false if the range is invalid */

Source from the content-addressed store, hash-verified

108
109 /** Removes `n` values starting at index `i`, or returns false if the range is invalid */
110 bool remove(size_t i, size_t n =1) {
111 if (_usuallyFalse(!MCollection::isMutable()))
112 return false;
113 size_t end = i + n;
114 if (end <= i)
115 return (end == i);
116 size_t cnt = count();
117 if (_usuallyFalse(end > cnt))
118 return false;
119 if (end < cnt)
120 populateVec();
121 MCollection::mutate();
122 _vec.erase(_vec.begin() + i, _vec.begin() + end);
123 return true;
124 }
125
126 /** Removes all items from the array. */
127 bool clear() {

Callers

nothing calls this directly

Calls 1

beginMethod · 0.45

Tested by

no test coverage detected