Skip to content

Commit 4c28248

Browse files
author
Dmitry Yashunin
committed
Do not save number of deleted elements
1 parent 4c687da commit 4c28248

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

hnswlib/hnswalg.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,6 @@ namespace hnswlib {
592592
writeBinaryPOD(output, offsetLevel0_);
593593
writeBinaryPOD(output, max_elements_);
594594
writeBinaryPOD(output, cur_element_count);
595-
writeBinaryPOD(output, num_deleted_);
596595
writeBinaryPOD(output, size_data_per_element_);
597596
writeBinaryPOD(output, label_offset_);
598597
writeBinaryPOD(output, offsetData_);
@@ -630,7 +629,6 @@ namespace hnswlib {
630629
readBinaryPOD(input, offsetLevel0_);
631630
readBinaryPOD(input, max_elements_);
632631
readBinaryPOD(input, cur_element_count);
633-
readBinaryPOD(input, num_deleted_);
634632

635633
size_t max_elements = max_elements_i;
636634
if(max_elements < cur_element_count)
@@ -717,6 +715,11 @@ namespace hnswlib {
717715
}
718716
}
719717

718+
for (size_t i = 0; i < cur_element_count; i++) {
719+
if(isMarkedDeleted(i))
720+
num_deleted_ += 1;
721+
}
722+
720723
input.close();
721724

722725
return;

0 commit comments

Comments
 (0)