mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
Replace NLPacket unique_ptr ctor with && ctor
This commit is contained in:
parent
9154067cfb
commit
0b3986ef9b
2 changed files with 4 additions and 4 deletions
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue