[Tile-serving] [osm2pgsql] Use std::vector for tags, members and nodes (#331)
Sarah Hoffmann
notifications at github.com
Mon Apr 13 17:57:27 UTC 2015
> - return;
> - }
> - for (i = 1; i < count; i ++) {
> - from_line(last_lon, last_lat, nodes[i].lon, nodes[i].lat);
> - last_lat = nodes[i].lat;
> - last_lon = nodes[i].lon;
> - }
> +void expire_tiles::from_nodes_line(const nodelist_t &nodes)
> +{
> + if (Options->expire_tiles_zoom < 0 || nodes.empty())
> + return;
> +
> + if (nodes.size() == 1) {
> + from_bbox(nodes[0].lon, nodes[0].lat, nodes[0].lon, nodes[0].lat);
> + } else {
> + for (int i = 1; i < nodes.size(); ++i)
In theory yes, but I found that version much more readable. With nodes being const, I trust that the compiler knows how to optimize the code correctly.
---
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/pull/331/files#r28261656
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20150413/f3fbbe3d/attachment.html>
More information about the Tile-serving
mailing list