wkb_reader : pre-allocate number of polygons in multi_polygon and number of geometries in geometry_collection via vector.reserce(...)

This commit is contained in:
artemp 2017-07-03 15:18:23 +02:00
parent 1e8ec57593
commit 71344f78df

View file

@ -351,6 +351,7 @@ private:
{
int num_polys = read_integer();
mapnik::geometry::multi_polygon<double> multi_poly;
multi_poly.reserve(num_polys);
for (int i = 0; i < num_polys; ++i)
{
pos_ += 5;
@ -363,6 +364,7 @@ private:
{
int num_geometries = read_integer();
mapnik::geometry::geometry_collection<double> collection;
collection.reserve(num_geometries);
for (int i = 0; i < num_geometries; ++i)
{
pos_ += 1; // skip byte order