Skip to content

Commit

Permalink
Merge branch 'dev' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
raissi-oussema authored Jan 9, 2025
2 parents 3ba3c71 + 6dd7c51 commit 7822458
Showing 1 changed file with 4 additions and 22 deletions.
26 changes: 4 additions & 22 deletions Common++/header/IpAddress.h
Original file line number Diff line number Diff line change
Expand Up @@ -707,18 +707,9 @@ namespace pcpp
/// @return A reference to the assignee
IPNetwork& operator=(const IPv4Network& other)
{
if (m_IPv4Network)
{
m_IPv4Network = nullptr;
}

if (m_IPv6Network)
{
m_IPv6Network = nullptr;
}

// Create the new instance first to maintain strong exception guarantee.
m_IPv4Network = std::unique_ptr<IPv4Network>(new IPv4Network(other));

m_IPv6Network = nullptr;
return *this;
}

Expand All @@ -727,18 +718,9 @@ namespace pcpp
/// @return A reference to the assignee
IPNetwork& operator=(const IPv6Network& other)
{
if (m_IPv4Network)
{
m_IPv4Network = nullptr;
}

if (m_IPv6Network)
{
m_IPv6Network = nullptr;
}

// Create the new instance first to maintain strong exception guarantee.
m_IPv6Network = std::unique_ptr<IPv6Network>(new IPv6Network(other));

m_IPv4Network = nullptr;
return *this;
}

Expand Down

0 comments on commit 7822458

Please sign in to comment.