We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5de0c43 commit e23f6caCopy full SHA for e23f6ca
hnswlib/hnswlib.h
@@ -439,7 +439,9 @@ class ChunkedArray {
439
char* operator[](size_t i) const {
440
assert(i < getCapacity());
441
if (i >= getCapacity()) return nullptr;
442
- return getElementNoRangeChecking(i);
+ size_t chunk_index = i / elements_per_chunk_;
443
+ size_t index_in_chunk = i % elements_per_chunk_;
444
+ return chunks_[chunk_index].get() + element_byte_size_ * index_in_chunk;
445
}
446
447
void clear() {
0 commit comments