Skip to content
Snippets Groups Projects
Commit b55b661b authored by Ben Boeckel's avatar Ben Boeckel
Browse files

IO/LANLX3D: fix `performance-unnecessary-copy-initialization` lints

parent 86a5322c
No related merge requests found
......@@ -46,13 +46,13 @@ streampos Reader::offset_of(const string& block)
size_t num_cached_blocks = offset.size();
if (num_cached_blocks)
{ // some blocks cached; start after them...
string last_block = TOP_BLOCK[num_cached_blocks - 1];
string const& last_block = TOP_BLOCK[num_cached_blocks - 1];
if (file.tellg() < offset.at(last_block)) // ...unless beyond them
file.seekg(offset.at(last_block)); // move to last cached block
}
for (size_t i = num_cached_blocks; i < TOP_BLOCK.size(); i++)
{
string next_block = TOP_BLOCK[i]; // look for next uncached block
string const& next_block = TOP_BLOCK[i]; // look for next uncached block
streampos position;
while ((position = file.tellg()) > 0)
{
......@@ -94,7 +94,7 @@ Reader::Reader(const string& filename_, const Version version_)
expect_starts_with(MAGIC_STRING); // match X3D header line
// Read Header Block
string block = TOP_BLOCK[0];
string const& block = TOP_BLOCK[0];
file.seekg(offset_of(block));
expect_starts_with(block);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment