Skip to content

Commit

Permalink
Fix: InBoundMatching does not properly accept passed-in buffer.
Browse files Browse the repository at this point in the history
InBoundMatching() checks whether the length of the passed-in buffer
is > 0 and if so, uses it. However, this does not properly handle
the case where the passed-in buffer is allocated, i.e. cap(buf) > 0 and
len(buf) == 0.
  • Loading branch information
Vuppuluri, Nirmal committed Dec 18, 2023
1 parent 74e0c28 commit 0df4b9e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion quadtree/quadtree.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ func (q *Quadtree) InBoundMatching(buf []orb.Pointer, b orb.Bound, f FilterFunc)
}

var p []orb.Pointer
if len(buf) > 0 {
if buf != nil {
p = buf[:0]
}
v := &inBoundVisitor{
Expand Down

0 comments on commit 0df4b9e

Please sign in to comment.