Skip to content

Commit 0df4b9e

Browse files
author
Vuppuluri, Nirmal
committed
Fix: InBoundMatching does not properly accept passed-in buffer.
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.
1 parent 74e0c28 commit 0df4b9e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

quadtree/quadtree.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ func (q *Quadtree) InBoundMatching(buf []orb.Pointer, b orb.Bound, f FilterFunc)
299299
}
300300

301301
var p []orb.Pointer
302-
if len(buf) > 0 {
302+
if buf != nil {
303303
p = buf[:0]
304304
}
305305
v := &inBoundVisitor{

0 commit comments

Comments
 (0)