Skip to content

Update removePoint in bruteforce.h#382

Open
bongmo wants to merge 2 commits intonmslib:developfrom
bongmo:master
Open

Update removePoint in bruteforce.h#382
bongmo wants to merge 2 commits intonmslib:developfrom
bongmo:master

Conversation

@bongmo
Copy link
Copy Markdown

@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
Comment thread hnswlib/bruteforce.h

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
Copy Markdown
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
Copy Markdown
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