Skip to content

Commit

Permalink
Merge pull request PointCloudLibrary#4255 from kunaltyagi/for-ref
Browse files Browse the repository at this point in the history
[IO] For const variable in ply parser, use reference
  • Loading branch information
kunaltyagi authored Jul 7, 2020
2 parents efbf54e + 279c427 commit ba5ad23
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions io/src/ply/ply_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ bool pcl::io::ply::ply_parser::parse (const std::string& filename)
// ascii
if (format == ascii_format)
{
for (const auto element_ptr: elements)
for (const auto &element_ptr: elements)
{
auto& element = *(element_ptr.get ());
for (std::size_t element_index = 0; element_index < element.count; ++element_index)
Expand All @@ -461,7 +461,7 @@ bool pcl::io::ply::ply_parser::parse (const std::string& filename)
stringstream.unsetf (std::ios_base::skipws);
stringstream >> std::ws;

for (const auto property_ptr: element.properties)
for (const auto &property_ptr: element.properties)
{
auto& property = *(property_ptr.get ());
if (!property.parse (*this, format, stringstream))
Expand Down Expand Up @@ -497,14 +497,14 @@ bool pcl::io::ply::ply_parser::parse (const std::string& filename)
istream.open (filename.c_str (), std::ios::in | std::ios::binary);
istream.seekg (data_start);

for (const auto element_ptr: elements)
for (const auto &element_ptr: elements)
{
auto& element = *(element_ptr.get ());
for (std::size_t element_index = 0; element_index < element.count; ++element_index)
{
if (element.begin_element_callback)
element.begin_element_callback ();
for (const auto property_ptr: element.properties)
for (const auto &property_ptr: element.properties)
{
auto& property = *(property_ptr.get ());
if (!property.parse (*this, format, istream))
Expand Down

0 comments on commit ba5ad23

Please sign in to comment.