File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed
Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -2332,6 +2332,7 @@ const std::vector<Rect>& dbBlock::getBlockedRegionsForPins()
23322332Polygon dbBlock::computeCoreArea ()
23332333{
23342334 std::vector<odb::Rect> rows;
2335+ rows.reserve (getRows ().size ());
23352336 for (dbRow* row : getRows ()) {
23362337 if (row->getSite ()->getClass () != odb::dbSiteClass::PAD) {
23372338 rows.push_back (row->getBBox ());
Original file line number Diff line number Diff line change @@ -70,15 +70,16 @@ std::vector<Polygon> Polygon::merge(const std::vector<Polygon>& polys)
7070 using BoostPolygonSet = boost::polygon::polygon_set_data<int >;
7171 using boost::polygon::operators::operator +=;
7272
73- // add to polygon set
74- BoostPolygonSet poly_in_set ;
75-
73+ // convert to boost polygon
74+ std::vector<BoostPolygon> boost_poly ;
75+ boost_poly. reserve (polys. size ());
7676 for (const Polygon& poly : polys) {
77- // convert to boost polygon
78- const BoostPolygon polygon_in (poly.points_ .begin (), poly.points_ .end ());
79- poly_in_set += polygon_in;
77+ boost_poly.emplace_back (poly.points_ .begin (), poly.points_ .end ());
8078 }
8179
80+ // add to polygon set
81+ const BoostPolygonSet poly_in_set (boost_poly.begin (), boost_poly.end ());
82+
8283 // extract new polygons
8384 std::vector<BoostPolygon> output_polygons;
8485 poly_in_set.get (output_polygons);
You can’t perform that action at this time.
0 commit comments