Don't copy structs in auto loop

This commit is contained in:
Mael Rouxel-Labbé 2020-01-25 13:00:52 +01:00
parent d8053f8198
commit 5906e3c341
1 changed files with 2 additions and 2 deletions

View File

@ -136,7 +136,7 @@ std::ostream& write_STL(std::ostream& out,
const boost::uint32_t N32 = static_cast<boost::uint32_t>(facets.size());
out.write(reinterpret_cast<const char *>(&N32), sizeof(N32));
for(auto face : facets)
for(const auto& face : facets)
{
const Point& p = points[face[0]];
const Point& q = points[face[1]];
@ -157,7 +157,7 @@ std::ostream& write_STL(std::ostream& out,
else
{
out << "solid\n";
for(auto face : facets)
for(const auto& face : facets)
{
const Point& p = points[face[0]];
const Point& q = points[face[1]];