From 30fd86ce69fa65e89dec119e23b5bccb54de70a3 Mon Sep 17 00:00:00 2001 From: gatecat Date: Wed, 16 Feb 2022 13:53:47 +0000 Subject: refactor: New NetInfo and CellInfo constructors --- common/basectx.cc | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'common/basectx.cc') diff --git a/common/basectx.cc b/common/basectx.cc index b9036ed6..b55cd072 100644 --- a/common/basectx.cc +++ b/common/basectx.cc @@ -211,8 +211,7 @@ NetInfo *BaseCtx::createNet(IdString name) { NPNR_ASSERT(!nets.count(name)); NPNR_ASSERT(!net_aliases.count(name)); - std::unique_ptr net{new NetInfo}; - net->name = name; + auto net = std::make_unique(name); net_aliases[name] = name; NetInfo *ptr = net.get(); nets[name] = std::move(net); @@ -252,9 +251,7 @@ void BaseCtx::lockNetRouting(IdString name) CellInfo *BaseCtx::createCell(IdString name, IdString type) { NPNR_ASSERT(!cells.count(name)); - std::unique_ptr cell{new CellInfo}; - cell->name = name; - cell->type = type; + auto cell = std::make_unique(getCtx(), name, type); CellInfo *ptr = cell.get(); cells[name] = std::move(cell); refreshUi(); -- cgit v1.2.3