Skip to content

Commit

Permalink
Patch 1 (#323)
Browse files Browse the repository at this point in the history
* feat: assert search layer

* add resolved comment
  • Loading branch information
friendlymatthew authored Jun 3, 2024
1 parent 8b581b8 commit 3d0a643
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pkg/hnsw/hnsw.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,7 @@ func (h *Hnsw) searchLevel(q *Point, entryItem *Item, numNearestToQToReturn, lev
foundNNToQ.Insert(ccFriendId, ccFriendDistToQ)

if foundNNToQ.Len() > numNearestToQToReturn {
_, err = foundNNToQ.PopItem()
if err != nil {
if _, err = foundNNToQ.PopItem(); err != nil {
return nil, fmt.Errorf("error during searching level %d: %w", level, err)
}
}
Expand Down

0 comments on commit 3d0a643

Please sign in to comment.