PLY-avoid-temporary-variable-and-push_back
This commit is contained in:
@@ -221,14 +221,11 @@ void _PLYReader_::readCreateCustomProperty(std::istream& _in, BaseImporter& _bi,
|
|||||||
//init vector
|
//init vector
|
||||||
int numberOfValues;
|
int numberOfValues;
|
||||||
read(_listType, _in, numberOfValues, OpenMesh::GenProg::Bool2Type<binary>());
|
read(_listType, _in, numberOfValues, OpenMesh::GenProg::Bool2Type<binary>());
|
||||||
std::vector<T> vec;
|
std::vector<T> vec(numberOfValues);
|
||||||
vec.reserve(numberOfValues);
|
|
||||||
//read and assign
|
//read and assign
|
||||||
for (int i = 0; i < numberOfValues; ++i)
|
for (int i = 0; i < numberOfValues; ++i)
|
||||||
{
|
{
|
||||||
T in;
|
read(_valueType, _in, vec[i], OpenMesh::GenProg::Bool2Type<binary>());
|
||||||
read(_valueType, _in, in, OpenMesh::GenProg::Bool2Type<binary>());
|
|
||||||
vec.push_back(in);
|
|
||||||
}
|
}
|
||||||
_bi.kernel()->property(prop,_h) = vec;
|
_bi.kernel()->property(prop,_h) = vec;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user