Move temporary into vector instead of copying (#1115)

more efficient.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev 2023-08-15 17:13:22 -07:00 committed by GitHub
parent bbb8221301
commit cf352ac7f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -236,7 +236,7 @@ void RIFF::File::setChunkData(const ByteVector &name, const ByteVector &data, bo
chunk.offset = offset + 8;
chunk.padding = data.size() % 2;
d->chunks.push_back(chunk);
d->chunks.push_back(std::move(chunk));
// Update the global size.
@ -338,7 +338,7 @@ void RIFF::File::read()
}
}
d->chunks.push_back(chunk);
d->chunks.push_back(std::move(chunk));
}
}