Merge #19771: net: Replace enum CConnMan::NumConnections with enum class ConnectionDirection

c77de622dd net: Replace enum CConnMan::NumConnections with enum class ConnectionDirection (Luke Dashjr)

Pull request description:

  Refactor split out of #17167

ACKs for top commit:
  practicalswift:
    cr ACK c77de622dd: patch looks correct & `enum class` is strictly better

Tree-SHA512: 40a1bf69d8ab2651b04ba6adbab789369a5a1a29a64ba764c3e6aab575b7943ea8dfd6e35b0abf5bcffa10e7265f4b523a93aa899c0fd581a84fc51ae5377b90
This commit is contained in:
MarcoFalke committed 2021-03-07 14:21:02 +01:00
commit 8c049fe9af
9 files changed
+36 -24

No files matched your search

+4 -4
View File
@@ -71,14 +71,14 @@ ClientModel::~ClientModel()
int ClientModel::getNumConnections(unsigned int flags) const
{
CConnman::NumConnections connections = CConnman::CONNECTIONS_NONE;
ConnectionDirection connections = ConnectionDirection::None;
if(flags == CONNECTIONS_IN)
connections = CConnman::CONNECTIONS_IN;
connections = ConnectionDirection::In;
else if (flags == CONNECTIONS_OUT)
connections = CConnman::CONNECTIONS_OUT;
connections = ConnectionDirection::Out;
else if (flags == CONNECTIONS_ALL)
connections = CConnman::CONNECTIONS_ALL;
connections = ConnectionDirection::Both;
return m_node.getNodeCount(connections);
}