Skip to content

Commit

Permalink
Hydrodynamics: use const reference when iterating over mesh vertices
Browse files Browse the repository at this point in the history
Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com>
  • Loading branch information
srmainwaring committed Dec 18, 2023
1 parent adba4b9 commit 0365e06
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gz-waves/src/systems/hydrodynamics/Hydrodynamics.cc
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ void ApplyPose(
it.second != std::end(_target.vertices());
++it.first, ++it.second)
{
auto& v0 = *it.first;
auto& v1 = *it.second;
const auto& v0 = *it.first;
const auto& v1 = *it.second;
const cgal::Point3& p0 = _source.point(v0);

// Affine transformation
Expand Down Expand Up @@ -183,7 +183,7 @@ math::AxisAlignedBox CreateAxisAlignedBox(cgal::MeshPtr _mesh)
double max_y = min_y;
double max_z = min_z;

for (auto& vertex : _mesh->vertices())
for (const auto& vertex : _mesh->vertices())
{
auto& point = _mesh->point(vertex);
min_x = std::min(point.x(), min_x);
Expand Down

0 comments on commit 0365e06

Please sign in to comment.