aboutsummaryrefslogtreecommitdiffstats
path: root/common/basectx.cc
diff options
context:
space:
mode:
authorgatecat <gatecat@ds0.me>2022-02-16 13:53:47 +0000
committergatecat <gatecat@ds0.me>2022-02-16 15:10:57 +0000
commit30fd86ce69fa65e89dec119e23b5bccb54de70a3 (patch)
tree7700f5ce4d8b40255aa54e08d2c4489e74b906ff /common/basectx.cc
parent02e6d2dbca0433e6f873c6af635cee701e84f5f5 (diff)
downloadnextpnr-30fd86ce69fa65e89dec119e23b5bccb54de70a3.tar.gz
nextpnr-30fd86ce69fa65e89dec119e23b5bccb54de70a3.tar.bz2
nextpnr-30fd86ce69fa65e89dec119e23b5bccb54de70a3.zip
refactor: New NetInfo and CellInfo constructors
Diffstat (limited to 'common/basectx.cc')
-rw-r--r--common/basectx.cc7
1 files changed, 2 insertions, 5 deletions
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<NetInfo> net{new NetInfo};
- net->name = name;
+ auto net = std::make_unique<NetInfo>(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<CellInfo> cell{new CellInfo};
- cell->name = name;
- cell->type = type;
+ auto cell = std::make_unique<CellInfo>(getCtx(), name, type);
CellInfo *ptr = cell.get();
cells[name] = std::move(cell);
refreshUi();