Skip to content

Commit 71a47d0

Browse files
authored
Merge pull request #1864 from joto/add-reserve
Add a reserve() to speed up geometry creation
2 parents 5b773b1 + d7a9ee2 commit 71a47d0

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)