mgastner / cartogram-cpp

Cartogram generator in C++
MIT License
8 stars 4 forks source link

Getter function might return large objects by value #163

Closed nihalzp closed 5 months ago

nihalzp commented 6 months ago
const std::vector<Ellipse> GeoDiv::min_ellipses() const
{
  return min_ellipses_;
}

For example, this code in geo_div.cpp might return the vector of ellipses by value which is inefficient. Should we change all occurances of getter functions to pass by reference for efficiency?