paulmach / orb

Types and utilities for working with 2d geometry in Golang
MIT License
886 stars 103 forks source link

Fix: InBoundMatching does not properly accept passed-in buffer #139

Closed nirmal-vuppuluri closed 8 months ago

nirmal-vuppuluri commented 8 months ago

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.

paulmach commented 8 months ago

Thank you