From 314b8642051d8eb418a28e728cf5dcb788815307 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Povi=C5=A1er?= Date: Fri, 13 Jan 2023 16:25:02 +0100 Subject: passes: show: Reuse string parts in generation of portboxes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Martin PoviĊĦer --- passes/cmds/show.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'passes/cmds') diff --git a/passes/cmds/show.cc b/passes/cmds/show.cc index db428b329..6e8ae6eda 100644 --- a/passes/cmds/show.cc +++ b/passes/cmds/show.cc @@ -289,9 +289,12 @@ struct ShowWorker } std::string repinfo = rep > 1 ? stringf("%dx ", rep) : ""; + std::string portside = stringf("%d:%d", pos, pos - rep*c.width + 1); + std::string remoteside = stringf("%s%d:%d", repinfo.c_str(), cl, cr); + if (driver) { log_assert(!net.empty()); - label_pieces.push_back(stringf(" %d:%d - %s%d:%d ", chunk_idx, pos, pos-rep*c.width+1, repinfo.c_str(), cl, cr)); + label_pieces.push_back(stringf(" %s - %s ", chunk_idx, portside.c_str(), remoteside.c_str())); net_conn_map[net].in.insert({stringf("x%d:s%d", dot_idx, chunk_idx), rep*c.width}); net_conn_map[net].color = nextColor(c, net_conn_map[net].color); } else { @@ -304,7 +307,7 @@ struct ShowWorker c.data.front() == State::Sz ? 'Z' : '?', pos, pos-rep*c.width+1)); } else { - label_pieces.push_back(stringf(" %s%d:%d - %d:%d ", chunk_idx, repinfo.c_str(), cl, cr, pos, pos-rep*c.width+1)); + label_pieces.push_back(stringf(" %s - %s ", chunk_idx, remoteside.c_str(), portside.c_str())); net_conn_map[net].out.insert({stringf("x%d:s%d", dot_idx, chunk_idx), rep*c.width}); net_conn_map[net].color = nextColor(c, net_conn_map[net].color); } -- cgit v1.2.3