Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
friendlymatthew committed Jul 8, 2024
1 parent 6017a80 commit f8b5e86
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions pkg/hnsw/heap.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package hnsw

import (
"fmt"
"maps"
"math/bits"
)

Expand Down Expand Up @@ -133,13 +134,8 @@ func (d *DistHeap) Clone() *DistHeap {
visited: make(map[Id]int, len(d.visited)),
}

for i, item := range d.items {
n.items[i] = &*item
}

for id, index := range d.visited {
n.visited[id] = index
}
copy(n.items, d.items)
maps.Copy(n.visited, d.visited)

return n
}
Expand Down

0 comments on commit f8b5e86

Please sign in to comment.