Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update removePoint in bruteforce.h #382

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open

Conversation

bongmo
Copy link

@bongmo bongmo commented Jun 7, 2022

  • When I add some points and delete all points, unordered_map remains item (bug)

yurymalkov and others added 2 commits April 15, 2022 19:58
Add information about the patent
- bruteforce.h : removePoint bug fix
@yurymalkov yurymalkov changed the base branch from master to develop June 12, 2022 22:38
@@ -78,7 +78,8 @@ namespace hnswlib {
dict_external_to_internal.erase(cur_external);

labeltype label=*((labeltype*)(data_ + size_per_element_ * (cur_element_count-1) + data_size_));
dict_external_to_internal[label]=cur_c;
if (cur_external != label)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess a check for cur_element_count>1 would be easier to read.
Also I think copying of the element in the next lines do not make any sense so should be in the same if

@yurymalkov
Copy link
Member

@bongmo thanks for the PR! That does seem like a bug.
A small suggestion would be to alter the change so it would be a bit easier to read (mentioned in the code comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants