diff --git a/libraries/networking/src/NLPacket.cpp b/libraries/networking/src/NLPacket.cpp index fb2561486a..39dc296f85 100644 --- a/libraries/networking/src/NLPacket.cpp +++ b/libraries/networking/src/NLPacket.cpp @@ -101,14 +101,6 @@ NLPacket::NLPacket(const NLPacket& other) : Packet(other) { _sourceID = other._sourceID; } -NLPacket& NLPacket::operator=(const NLPacket& other) { - Packet::operator=(other); - - _sourceID = other._sourceID; - - return *this; -} - NLPacket::NLPacket(std::unique_ptr data, qint64 size, const HifiSockAddr& senderSockAddr) : Packet(std::move(data), size, senderSockAddr) { @@ -126,6 +118,14 @@ NLPacket::NLPacket(NLPacket&& other) : _sourceID = std::move(other._sourceID); } +NLPacket& NLPacket::operator=(const NLPacket& other) { + Packet::operator=(other); + + _sourceID = other._sourceID; + + return *this; +} + NLPacket& NLPacket::operator=(NLPacket&& other) { Packet::operator=(std::move(other)); diff --git a/libraries/networking/src/NLPacket.h b/libraries/networking/src/NLPacket.h index aad6e6d072..57c099764a 100644 --- a/libraries/networking/src/NLPacket.h +++ b/libraries/networking/src/NLPacket.h @@ -51,8 +51,9 @@ protected: NLPacket(std::unique_ptr data, qint64 size, const HifiSockAddr& senderSockAddr); NLPacket(std::unique_ptr packet); NLPacket(const NLPacket& other); - NLPacket& operator=(const NLPacket& other); NLPacket(NLPacket&& other); + + NLPacket& operator=(const NLPacket& other); NLPacket& operator=(NLPacket&& other); void readSourceID();