Skip to content

Commit

Permalink
Small refactoring of inverted lists (facebookresearch#3055)
Browse files Browse the repository at this point in the history
Summary: Pull Request resolved: facebookresearch#3055

Reviewed By: mlomeli1

Differential Revision: D49859119

Pulled By: mdouze

fbshipit-source-id: 7b457ffcae6cbcd732abcf34f87f5037697c4494
  • Loading branch information
alexanderguzhva authored and facebook-github-bot committed Oct 4, 2023
1 parent 834c543 commit 3f3321c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion faiss/invlists/DirectMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ size_t DirectMap::remove_ids(const IDSelector& sel, InvertedLists* invlists) {
last_id,
ScopedCodes(invlists, list_no, last).get());
// update hash entry for last element
hashtable[last_id] = list_no << 32 | offset;
hashtable[last_id] = lo_build(list_no, offset);
}
invlists->resize(list_no, last);
nremove++;
Expand Down
4 changes: 2 additions & 2 deletions faiss/invlists/OnDiskInvertedLists.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ void OnDiskInvertedLists::free_slot(size_t offset, size_t capacity) {
it++;
}

size_t inf = 1UL << 60;
size_t inf = ((size_t)1) << 60;

size_t end_prev = inf;
if (it != slots.begin()) {
Expand All @@ -533,7 +533,7 @@ void OnDiskInvertedLists::free_slot(size_t offset, size_t capacity) {
end_prev = prev->offset + prev->capacity;
}

size_t begin_next = 1L << 60;
size_t begin_next = ((size_t)1) << 60;
if (it != slots.end()) {
begin_next = it->offset;
}
Expand Down

0 comments on commit 3f3321c

Please sign in to comment.