From c52419411e0fb7e432684e310111f822be4f6145 Mon Sep 17 00:00:00 2001 From: Leonard Ossa Date: Tue, 9 Jul 2024 15:34:55 +0200 Subject: [PATCH] Refactor enum to enum class in addrspacesplit Signed-off-by: Leonard Ossa --- openvpn/addr/addrspacesplit.hpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/openvpn/addr/addrspacesplit.hpp b/openvpn/addr/addrspacesplit.hpp index f18628e2..bfebb213 100644 --- a/openvpn/addr/addrspacesplit.hpp +++ b/openvpn/addr/addrspacesplit.hpp @@ -53,7 +53,7 @@ class AddressSpaceSplitter : public RouteList } private: - enum Type + enum class Type { EQUAL, SUBROUTE, @@ -72,7 +72,7 @@ class AddressSpaceSplitter : public RouteList { switch (find(in, route)) { - case SUBROUTE: + case Type::SUBROUTE: { Route r1, r2; if (route.split(r1, r2)) @@ -84,8 +84,8 @@ class AddressSpaceSplitter : public RouteList push_back(route); break; } - case EQUAL: - case LEAF: + case Type::EQUAL: + case Type::LEAF: push_back(route); break; } @@ -93,14 +93,14 @@ class AddressSpaceSplitter : public RouteList static Type find(const RouteList &in, const Route &route) { - Type type = LEAF; + Type type = Type::LEAF; for (RouteList::const_iterator i = in.begin(); i != in.end(); ++i) { const Route &r = *i; if (route == r) - type = EQUAL; + type = Type::EQUAL; else if (route.contains(r)) - return SUBROUTE; + return Type::SUBROUTE; } return type; }