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:
parent
1e8ec57593
commit
71344f78df
1 changed files with 2 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue