Skip to content

Commit 62e4623

Browse files
Small refactoring of inverted lists
1 parent c8d6f7b commit 62e4623

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

faiss/invlists/DirectMap.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ size_t DirectMap::remove_ids(const IDSelector& sel, InvertedLists* invlists) {
199199
last_id,
200200
ScopedCodes(invlists, list_no, last).get());
201201
// update hash entry for last element
202-
hashtable[last_id] = list_no << 32 | offset;
202+
hashtable[last_id] = lo_build(list_no, offset);
203203
}
204204
invlists->resize(list_no, last);
205205
nremove++;

faiss/invlists/OnDiskInvertedLists.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ void OnDiskInvertedLists::free_slot(size_t offset, size_t capacity) {
524524
it++;
525525
}
526526

527-
size_t inf = 1UL << 60;
527+
size_t inf = ((size_t)1) << 60;
528528

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

536-
size_t begin_next = 1L << 60;
536+
size_t begin_next = ((size_t)1) << 60;
537537
if (it != slots.end()) {
538538
begin_next = it->offset;
539539
}

0 commit comments

Comments
 (0)