mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 16:55:07 +02:00
Remove unnecessary move
This commit is contained in:
parent
05dd49a4c5
commit
b4121eb464
9 changed files with 12 additions and 13 deletions
|
@ -1797,7 +1797,7 @@ void Application::sendPingPackets() {
|
|||
return false;
|
||||
}
|
||||
}, [nodeList](const SharedNodePointer& node) {
|
||||
nodeList->sendPacket(std::move(nodeList->constructPingPacket()), *node);
|
||||
nodeList->sendPacket(nodeList->constructPingPacket(), *node);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -826,7 +826,7 @@ std::unique_ptr<NLPacket> EntityTree::encodeEntitiesDeletedSince(OCTREE_PACKET_S
|
|||
deletesPacket->seek(numberOfIDsPos);
|
||||
deletesPacket->writePrimitive(numberOfIDs);
|
||||
|
||||
return std::move(deletesPacket);
|
||||
return deletesPacket;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -290,7 +290,7 @@ qint64 LimitedNodeList::sendPacketList(NLPacketList& packetList, const Node& des
|
|||
packetList.closeCurrentPacket();
|
||||
|
||||
while (!packetList._packets.empty()) {
|
||||
bytesSent += sendPacket(std::move(packetList.takeFront<NLPacket>()), destinationNode);
|
||||
bytesSent += sendPacket(packetList.takeFront<NLPacket>(), destinationNode);
|
||||
}
|
||||
|
||||
return bytesSent;
|
||||
|
@ -304,7 +304,7 @@ qint64 LimitedNodeList::sendPacketList(NLPacketList& packetList, const HifiSockA
|
|||
packetList.closeCurrentPacket();
|
||||
|
||||
while (!packetList._packets.empty()) {
|
||||
bytesSent += sendPacket(std::move(packetList.takeFront<NLPacket>()), sockAddr, connectionSecret);
|
||||
bytesSent += sendPacket(packetList.takeFront<NLPacket>(), sockAddr, connectionSecret);
|
||||
}
|
||||
|
||||
return bytesSent;
|
||||
|
|
|
@ -17,6 +17,6 @@ NLPacketList::NLPacketList(PacketType::Value packetType) : PacketList(packetType
|
|||
}
|
||||
|
||||
std::unique_ptr<Packet> NLPacketList::createPacket() {
|
||||
return std::move(NLPacket::create(getType()));
|
||||
return NLPacket::create(getType());
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ void PacketList::endSegment() {
|
|||
|
||||
std::unique_ptr<Packet> PacketList::createPacket() {
|
||||
// use the static create method to create a new packet
|
||||
return std::move(Packet::create(getType()));
|
||||
return Packet::create(getType());
|
||||
}
|
||||
|
||||
std::unique_ptr<Packet> PacketList::createPacketWithExtendedHeader() {
|
||||
|
@ -46,7 +46,7 @@ std::unique_ptr<Packet> PacketList::createPacketWithExtendedHeader() {
|
|||
}
|
||||
}
|
||||
|
||||
return std::move(packet);
|
||||
return packet;
|
||||
}
|
||||
|
||||
qint64 PacketList::writeData(const char* data, qint64 maxSize) {
|
||||
|
|
|
@ -80,7 +80,7 @@ template<typename T> std::unique_ptr<T> PacketList::takeFront() {
|
|||
|
||||
auto packet = std::move(_packets.front());
|
||||
_packets.pop_front();
|
||||
return std::move(std::unique_ptr<T>(dynamic_cast<T*>(packet.release())));
|
||||
return std::unique_ptr<T>(dynamic_cast<T*>(packet.release()));
|
||||
}
|
||||
|
||||
#endif // hifi_PacketList_h
|
|
@ -260,7 +260,7 @@ std::unique_ptr<NLPacket> JurisdictionMap::packEmptyJurisdictionIntoMessage(Node
|
|||
// No root or end node details to pack!
|
||||
packet->writePrimitive(bytes);
|
||||
|
||||
return std::move(packet); // includes header!
|
||||
return packet; // includes header!
|
||||
}
|
||||
|
||||
std::unique_ptr<NLPacket> JurisdictionMap::packIntoPacket() {
|
||||
|
@ -295,7 +295,7 @@ std::unique_ptr<NLPacket> JurisdictionMap::packIntoPacket() {
|
|||
packet->writePrimitive(bytes);
|
||||
}
|
||||
|
||||
return std::move(packet);
|
||||
return packet;
|
||||
}
|
||||
|
||||
int JurisdictionMap::unpackFromPacket(NLPacket& packet) {
|
||||
|
|
|
@ -121,8 +121,7 @@ void OctreeEditPacketSender::processPreServerExistsPackets() {
|
|||
// First send out all the single message packets...
|
||||
_pendingPacketsLock.lock();
|
||||
while (!_preServerSingleMessagePackets.empty()) {
|
||||
std::unique_ptr<NLPacket> packet = std::move(_preServerSingleMessagePackets.front());
|
||||
queuePacketToNodes(std::move(packet));
|
||||
queuePacketToNodes(std::move(_preServerSingleMessagePackets.front()));
|
||||
_preServerSingleMessagePackets.pop_front();
|
||||
}
|
||||
|
||||
|
|
|
@ -327,7 +327,7 @@ glm::vec2 toGlm(const QPointF & pt) {
|
|||
|
||||
glm::vec3 toGlm(const xColor & color) {
|
||||
static const float MAX_COLOR = 255.0f;
|
||||
return std::move(glm::vec3(color.red / MAX_COLOR, color.green / MAX_COLOR, color.blue / MAX_COLOR));
|
||||
return glm::vec3(color.red, color.green, color.blue) / MAX_COLOR;
|
||||
}
|
||||
|
||||
glm::vec4 toGlm(const QColor & color) {
|
||||
|
|
Loading…
Reference in a new issue