qvec: fix undefined behaviour in PolyCentroid

This commit is contained in:
Eric Wasylishen 2021-10-11 12:59:37 -06:00
parent fe99d69d07
commit a60581c99a
1 changed files with 1 additions and 1 deletions

View File

@ -423,7 +423,7 @@ template<typename Iter, typename T = typename std::iterator_traits<Iter>::value_
else if (num_points == 1)
return *begin;
else if (num_points == 2)
return avg(*begin, *(++begin));
return avg(*begin, *(begin + 1));
T poly_centroid{};
value_type poly_area = 0;