Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -794,13 +794,14 @@ size_t Index<T, TagT, LabelT>::load_graph(std::string filename, size_t expected_
template <typename T, typename TagT, typename LabelT> int Index<T, TagT, LabelT>::get_vector_by_tag(TagT &tag, T *vec)
{
std::shared_lock<std::shared_timed_mutex> lock(_tag_lock);
if (_tag_to_location.find(tag) == _tag_to_location.end())
const auto tagIt = _tag_to_location.find(tag);
if (tagIt == _tag_to_location.end())
{
diskann::cout << "Tag " << tag << " does not exist" << std::endl;
// diskann::cout << "Tag " << tag << " does not exist" << std::endl;
return -1;
}

size_t location = _tag_to_location[tag];
const unsigned location = tagIt->second;
memcpy((void *)vec, (void *)(_data + location * _aligned_dim), (size_t)_dim * sizeof(T));
return 0;
}
Expand Down
Loading