Skip to content

Commit

Permalink
Refactor enum to enum class in addrspacesplit
Browse files Browse the repository at this point in the history
Signed-off-by: Leonard Ossa <[email protected]>
  • Loading branch information
Leonard Ossa committed Jul 10, 2024
1 parent a00a4c6 commit c524194
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions openvpn/addr/addrspacesplit.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class AddressSpaceSplitter : public RouteList
}

private:
enum Type
enum class Type
{
EQUAL,
SUBROUTE,
Expand All @@ -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))
Expand All @@ -84,23 +84,23 @@ class AddressSpaceSplitter : public RouteList
push_back(route);
break;
}
case EQUAL:
case LEAF:
case Type::EQUAL:
case Type::LEAF:
push_back(route);
break;
}
}

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;
}
Expand Down

0 comments on commit c524194

Please sign in to comment.