akuukka / quickhull

C++ implementation of the 3D QuickHull algorithm
266 stars 52 forks source link

Referencing address of first element in vector instead of using data() #20

Closed Pindrought closed 1 year ago

Pindrought commented 1 year ago

https://github.com/akuukka/quickhull/blob/master/Structs/VertexDataSource.hpp#L18

Using the following is problematic here since in the case of an empty vector this will cause an exception to be hit in debug mode.

 m_ptr(&vec[0])

Suggested fix:

 m_ptr(vec.data())
akuukka commented 1 year ago

Thanks! Fixed.