Replace NLPacket unique_ptr ctor with && ctor

This commit is contained in:
Ryan Huffman 2015-08-18 23:09:02 -07:00
parent 9154067cfb
commit 0b3986ef9b
2 changed files with 4 additions and 4 deletions

View file

@ -54,7 +54,7 @@ std::unique_ptr<NLPacket> NLPacket::fromBase(std::unique_ptr<Packet> packet) {
Q_ASSERT(packet);
// call our constructor to create an NLPacket from this Packet
return std::unique_ptr<NLPacket>(new NLPacket(std::move(packet)));
return std::unique_ptr<NLPacket>(new NLPacket(std::move(*packet)));
}
std::unique_ptr<NLPacket> NLPacket::createCopy(const NLPacket& other) {
@ -71,8 +71,8 @@ NLPacket::NLPacket(PacketType type, qint64 size, bool isReliable, bool isPartOfM
writeTypeAndVersion();
}
NLPacket::NLPacket(std::unique_ptr<Packet> packet) :
Packet(std::move(*packet.release()))
NLPacket::NLPacket(Packet&& packet) :
Packet(std::move(packet))
{
readType();
readVersion();

View file

@ -63,10 +63,10 @@ protected:
NLPacket(PacketType type, qint64 size = -1, bool forceReliable = false, bool isPartOfMessage = false);
NLPacket(std::unique_ptr<char[]> data, qint64 size, const HifiSockAddr& senderSockAddr);
NLPacket(std::unique_ptr<Packet> packet);
NLPacket(const NLPacket& other);
NLPacket(NLPacket&& other);
NLPacket(Packet&& other);
NLPacket& operator=(const NLPacket& other);
NLPacket& operator=(NLPacket&& other);