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

Method getFromArray

Fleece/Core/Path.cc:321–332  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

319
320
321 const Value* Path::Element::getFromArray(const Value* item, int32_t index) noexcept {
322 auto a = item->asArray();
323 if (_usuallyFalse(!a))
324 return nullptr;
325 if (index < 0) {
326 uint32_t count = a->count();
327 if (_usuallyFalse((uint32_t)-index > count))
328 return nullptr;
329 index += count;
330 }
331 return a->get((uint32_t)index);
332 }
333
334} }

Callers

nothing calls this directly

Calls 3

asArrayMethod · 0.45
countMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected