MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / _DataBlock_IndexOutOfBounds

Function _DataBlock_IndexOutOfBounds

src/util/datablock/datablock.c:60–66  ·  view source on GitHub ↗

Checks to see if idx is within global array bounds array bounds are between 0 and itemCount + #deleted indices e.g. [3, 7, 2, D, 1, D, 5] where itemCount = 5 and #deleted indices is 2 and so it is valid to query the array with idx 6.

Source from the content-addressed store, hash-verified

58// e.g. [3, 7, 2, D, 1, D, 5] where itemCount = 5 and #deleted indices is 2
59// and so it is valid to query the array with idx 6.
60static inline bool _DataBlock_IndexOutOfBounds
61(
62 const DataBlock *dataBlock,
63 uint64_t idx
64) {
65 return (idx >= (dataBlock->itemCount + array_len(dataBlock->deletedIdx)));
66}
67
68DataBlockItemHeader *DataBlock_GetItemHeader
69(

Callers 2

DataBlock_GetItemFunction · 0.85
DataBlock_DeleteItemFunction · 0.85

Calls 1

array_lenFunction · 0.85

Tested by

no test coverage detected