From cbcff4953f486fe89d2f00ed25a7cffc38796d47 Mon Sep 17 00:00:00 2001 From: caktux Date: Thu, 24 Jul 2014 12:57:20 -0400 Subject: [PATCH] neth: format peers --- neth/main.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/neth/main.cpp b/neth/main.cpp index 652f0b498..2f7844b12 100644 --- a/neth/main.cpp +++ b/neth/main.cpp @@ -947,14 +947,14 @@ int main(int argc, char** argv) // Peers y = 1; - string psc; - string pss; - auto cp = c.peers(); - psc = toString(cp.size()) + " peer(s)"; - for (PeerInfo const& i: cp) + for (PeerInfo const& i: c.peers()) { - pss = toString(chrono::duration_cast(i.lastPing).count()) + " ms - " + i.host + ":" + toString(i.port) + " - " + i.clientVersion; - mvwaddnstr(peerswin, y++, x, pss.c_str(), qwidth); + auto s = boost::format("%1% ms - %2%:%3% - %4%") % + toString(chrono::duration_cast(i.lastPing).count()) % + i.host % + toString(i.port) % + i.clientVersion; + mvwaddnstr(peerswin, y++, x, s.str().c_str(), qwidth); if (y > height * 2 / 5 - 4) break; }