[Tile-serving] [osm2pgsql] Cleanup based on the output of LLVM's static analyzer (#299)
Sarah Hoffmann
notifications at github.com
Sat Feb 21 17:07:08 UTC 2015
> @@ -363,7 +361,7 @@ geometry_builder::maybe_wkts_t geometry_builder::build_polygons(const osmNode *
> WKTWriter writer;
>
> // Procces ways into lines or simple polygon list
> - polygondata* polys = new polygondata[merged->size()];
> + std::vector<polygondata> polys(merged->size());
If you do that (and I'm all in favour), it would be better to go the whole nine yards and write a constructor for polygondata from gf and merged[i] and then use push_back(). totalpolys can then be replaced by a simple polys.size(). Also means that you can reduce the code duplication with the same stuff below.
---
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/pull/299/files#r25123613
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20150221/d456bc10/attachment-0001.html>
More information about the Tile-serving
mailing list