From 558a753d3da5a2243a74b8d4e1c24044bdfb5c2e Mon Sep 17 00:00:00 2001 From: Keith Rothman <537074+litghost@users.noreply.github.com> Date: Wed, 17 Feb 2021 10:18:24 -0800 Subject: Refactor "get only from iterator" to a utility. Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com> --- fpga_interchange/arch.cc | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'fpga_interchange/arch.cc') diff --git a/fpga_interchange/arch.cc b/fpga_interchange/arch.cc index 561f495d..cce93844 100644 --- a/fpga_interchange/arch.cc +++ b/fpga_interchange/arch.cc @@ -806,11 +806,8 @@ void Arch::map_cell_pins(CellInfo *cell, int32_t mapping) const void Arch::map_port_pins(BelId bel, CellInfo *cell) const { IdStringRange pins = getBelPins(bel); - NPNR_ASSERT(pins.begin() != pins.end()); - auto b = pins.begin(); - IdString pin = *b; - ++b; - NPNR_ASSERT(b == pins.end()); + IdString pin = get_only_value(pins); + NPNR_ASSERT(cell->ports.size() == 1); cell->cell_bel_pins[cell->ports.begin()->first].clear(); cell->cell_bel_pins[cell->ports.begin()->first].push_back(pin); -- cgit v1.2.3