MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / fastRemove

Method fastRemove

Source/Support/Array.cpp:98–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96}
97
98bool Array::fastRemove(NotNull<Value, 1> value) {
99 AssertIf(_traversing, "Can not remove item from array while traversing");
100 size_t ind = index(value);
101 if (ind < _data.size()) {
102 _data.at(ind) = std::move(_data.back());
103 _data.pop_back();
104 return true;
105 }
106 return false;
107}
108
109void Array::swap(NotNull<Value, 1> objectA, NotNull<Value, 2> objectB) {
110 std::swap(_data[index(objectA)], _data[index(objectB.get())]);

Callers 3

Array_fastRemoveFunction · 0.80
array_fast_removeFunction · 0.80
removeMethod · 0.80

Calls 5

moveFunction · 0.85
sizeMethod · 0.45
atMethod · 0.45
backMethod · 0.45
pop_backMethod · 0.45

Tested by

no test coverage detected