[Tile-serving] [osm2pgsql] Fix incorrect resizing of node cache in geometry processor (#322)
Paul Norman
notifications at github.com
Thu Apr 2 07:45:00 UTC 2015
> @@ -75,11 +75,12 @@ way_helper::~way_helper()
> }
> size_t way_helper::set(const osmid_t *node_ids, size_t node_count, const middle_query_t *mid)
> {
> - //if we don't have enough space already get more
> - if(node_cache.size() < node_count)
> - node_cache.resize(node_count);
> - //get the node data
> - mid->nodes_get_list(&node_cache.front(), node_ids, node_count);
> + // other parts of the code assume that the node cache is the size of the way
> + // TODO: Fix this, and use std::vector everywhere
> + node_cache.resize(node_count);
std::vector is linear with erased items, so this should be fast if node_cache.size() = node_count
---
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/pull/322/files#r27637711
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20150402/8518b2b7/attachment-0001.html>
More information about the Tile-serving
mailing list