MCPcopy Index your code
hub / github.com/sqlmapproject/sqlmap / __getitem__

Method __getitem__

lib/core/bigarray.py:259–279  ·  view source on GitHub ↗
(self, y)

Source from the content-addressed store, hash-verified

257 self.chunks.append(chunk)
258
259 def __getitem__(self, y):
260 with self._lock:
261 length = len(self)
262 if length == 0:
263 raise IndexError("BigArray index out of range")
264
265 if y < 0:
266 y += length
267
268 if y < 0 or y >= length:
269 raise IndexError("BigArray index out of range")
270
271 index = y // self.chunk_length
272 offset = y % self.chunk_length
273 chunk = self.chunks[index]
274
275 if isinstance(chunk, list):
276 return chunk[offset]
277 else:
278 self._checkcache(index)
279 return self.cache.data[offset]
280
281 def __setitem__(self, y, value):
282 with self._lock:

Callers

nothing calls this directly

Calls 1

_checkcacheMethod · 0.95

Tested by

no test coverage detected