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

Method index

Source/Support/Array.cpp:127–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

125}
126
127int Array::index(NotNull<Value, 1> value) {
128 auto it = std::find_if(_data.begin(), _data.end(), [&](const Own<Value>& val) {
129 return value->equals(val.get());
130 });
131 if (it == _data.end()) {
132 return -1;
133 }
134 return s_cast<int>(std::distance(_data.begin(), it));
135}
136
137void Array::set(size_t index, Own<Value>&& value) {
138 _data[index] = std::move(value);

Callers 2

Array_indexFunction · 0.45
array_indexFunction · 0.45

Calls 5

getMethod · 0.65
distanceFunction · 0.50
beginMethod · 0.45
endMethod · 0.45
equalsMethod · 0.45

Tested by

no test coverage detected