Skip to content

Commit

Permalink
Fix clang
Browse files Browse the repository at this point in the history
  • Loading branch information
Beihao-Zhou committed Jul 24, 2024
1 parent 1a85e49 commit e41cd9b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/search/hnsw_indexer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ StatusOr<std::vector<KeyWithDistance>> HnswIndex::ExpandSearchScope(const kqir::
&neighbour_node_vector));

auto dist = GET_OR_RET(ComputeSimilarity(query_vector_item, neighbour_node_vector));
result.emplace_back(dist, std::move(neighbour_key));
result.emplace_back(dist, neighbour_key);
}
}
std::sort(result.begin(), result.end(),
Expand Down
3 changes: 2 additions & 1 deletion tests/cppunit/hnsw_index_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

auto GetVectorKeys(const std::vector<redis::KeyWithDistance>& keys_by_dist) -> std::vector<std::string> {
std::vector<std::string> result;
result.reserve(keys_by_dist.size());
for (const auto& [dist, key] : keys_by_dist) {
result.push_back(key);
}
Expand All @@ -49,7 +50,7 @@ void InsertEntryIntoHnswIndex(std::string_view key, const kqir::NumericArray& ve
}

void VerifyNodeMetadataAndNeighbours(redis::HnswNode* node, redis::HnswIndex* hnsw_index,
std::unordered_set<std::string> expected_set) {
const std::unordered_set<std::string>& expected_set) {
auto s = node->DecodeMetadata(hnsw_index->search_key, hnsw_index->storage);
ASSERT_TRUE(s.IsOK());
auto node_meta = s.GetValue();
Expand Down

0 comments on commit e41cd9b

Please sign in to comment.