Skip to content

Commit ba5ad23

Browse files
authored
Merge pull request #4255 from kunaltyagi/for-ref
[IO] For const variable in ply parser, use reference
2 parents efbf54e + 279c427 commit ba5ad23

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

io/src/ply/ply_parser.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ bool pcl::io::ply::ply_parser::parse (const std::string& filename)
443443
// ascii
444444
if (format == ascii_format)
445445
{
446-
for (const auto element_ptr: elements)
446+
for (const auto &element_ptr: elements)
447447
{
448448
auto& element = *(element_ptr.get ());
449449
for (std::size_t element_index = 0; element_index < element.count; ++element_index)
@@ -461,7 +461,7 @@ bool pcl::io::ply::ply_parser::parse (const std::string& filename)
461461
stringstream.unsetf (std::ios_base::skipws);
462462
stringstream >> std::ws;
463463

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

500-
for (const auto element_ptr: elements)
500+
for (const auto &element_ptr: elements)
501501
{
502502
auto& element = *(element_ptr.get ());
503503
for (std::size_t element_index = 0; element_index < element.count; ++element_index)
504504
{
505505
if (element.begin_element_callback)
506506
element.begin_element_callback ();
507-
for (const auto property_ptr: element.properties)
507+
for (const auto &property_ptr: element.properties)
508508
{
509509
auto& property = *(property_ptr.get ());
510510
if (!property.parse (*this, format, istream))

0 commit comments

Comments
 (0)