Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry Yashunin committed Nov 26, 2022
1 parent c750df8 commit 7db5671
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion hnswlib/hnswalg.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class HierarchicalNSW : public AlgorithmInterface<dist_t> {
static const unsigned char DELETE_MARK = 0x01;

size_t max_elements_{0};
size_t cur_element_count{0};
mutable std::atomic<size_t> cur_element_count{0}; // current number of elements
size_t size_data_per_element_{0};
size_t size_links_per_element_{0};
mutable std::atomic<size_t> num_deleted_{0}; // number of deleted elements
Expand Down
2 changes: 1 addition & 1 deletion python_bindings/bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1006,7 +1006,7 @@ PYBIND11_PLUGIN(hnswlib) {
return index.index_inited ? index.appr_alg->max_elements_ : 0;
})
.def_property_readonly("element_count", [](const Index<float> & index) {
return index.index_inited ? index.appr_alg->cur_element_count : 0;
return index.index_inited ? (size_t)index.appr_alg->cur_element_count : 0;
})
.def_property_readonly("ef_construction", [](const Index<float> & index) {
return index.index_inited ? index.appr_alg->ef_construction_ : 0;
Expand Down

0 comments on commit 7db5671

Please sign in to comment.