Commit b15e09d1 authored by Jan Möbius's avatar Jan Möbius

PLY-avoid-temporary-variable-and-push_back

parent bb2f923f
......@@ -221,14 +221,11 @@ void _PLYReader_::readCreateCustomProperty(std::istream& _in, BaseImporter& _bi,
//init vector
int numberOfValues;
read(_listType, _in, numberOfValues, OpenMesh::GenProg::Bool2Type<binary>());
std::vector<T> vec;
vec.reserve(numberOfValues);
std::vector<T> vec(numberOfValues);
//read and assign
for (int i = 0; i < numberOfValues; ++i)
{
T in;
read(_valueType, _in, in, OpenMesh::GenProg::Bool2Type<binary>());
vec.push_back(in);
read(_valueType, _in, vec[i], OpenMesh::GenProg::Bool2Type<binary>());
}
_bi.kernel()->property(prop,_h) = vec;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment