aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/daemon/rpc_command_executor.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/daemon/rpc_command_executor.cpp b/src/daemon/rpc_command_executor.cpp
index 83620f417..f6746b8ad 100644
--- a/src/daemon/rpc_command_executor.cpp
+++ b/src/daemon/rpc_command_executor.cpp
@@ -644,12 +644,9 @@ bool t_rpc_command_executor::print_connections() {
}
}
- auto longest_host = *std::max_element(res.connections.begin(), res.connections.end(),
- [](const auto &info1, const auto &info2)
- {
- return info1.address.length() < info2.address.length();
- });
- int host_field_width = std::max(15, 8 + (int) longest_host.address.length());
+ int host_field_width = 15;
+ for (const auto &conn : res.connections)
+ host_field_width = std::max(host_field_width, 8 + (int) conn.address.length());
tools::msg_writer() << std::setw(host_field_width) << std::left << "Remote Host"
<< std::setw(8) << "Type"