MCPcopy Create free account
hub / github.com/couchbase/fleece / operator[]

Method operator[]

Fleece/Core/Array.cc:72–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70 }
71
72 __hot
73 const Value* Array::impl::operator[] (unsigned index) const noexcept {
74 if (_usuallyFalse(index >= _count))
75 return nullptr;
76 if (_width == kNarrow)
77 return offsetby(_first, kNarrow * index)->deref<false>();
78 else if (_usuallyTrue(_width == kWide))
79 return offsetby(_first, kWide * index)->deref<true>();
80 else
81 return ((ValueSlot*)_first + index)->asValue();
82 }
83
84 const Value* Array::impl::firstValue() const noexcept {
85 if (_usuallyFalse(_count == 0))

Callers

nothing calls this directly

Calls 2

offsetbyFunction · 0.85
asValueMethod · 0.45

Tested by

no test coverage detected