diff --git a/plugins/input/shape/shape_io.cpp b/plugins/input/shape/shape_io.cpp index ddef77c85..cce40a9f0 100644 --- a/plugins/input/shape/shape_io.cpp +++ b/plugins/input/shape/shape_io.cpp @@ -109,12 +109,9 @@ mapnik::geometry::geometry shape_io::read_polyline(shape_file::record_ty } else { - std::vector parts(num_parts); - for (int i = 0; i < num_parts; ++i) - { - parts[i] = record.read_ndr_integer(); - } - + std::vector parts; + parts.resize(num_parts); + std::for_each(parts.begin(), parts.end(), [&](int & part) { part = record.read_ndr_integer();}); int start, end; mapnik::geometry::multi_line_string multi_line; for (int k = 0; k < num_parts; ++k)