Skip to content

Commit d7a9ee2

Browse files
committed
Add a reserve() to speed up geometry creation
1 parent 7660648 commit d7a9ee2

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/geom-from-osm.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ static bool fill_point_list(point_list_t *list,
4141
{
4242
osmium::Location last{};
4343

44+
list->reserve(nodes.size());
4445
for (auto const &node : nodes) {
4546
auto const loc = node.location();
4647
if (loc.valid() && loc != last) {

0 commit comments

Comments
 (0)