yuzu-emu
/
yuzu
Archived
1
0
Fork 0

vi: std::move std::vector in constructors where applicable

Allows avoiding unnecessary copies of the vector depending on the
calling code.

While we're at it, remove a redundant no-parameter base constructor call
This commit is contained in:
Lioncash 2018-07-23 14:48:53 -04:00
parent 7138b99f21
commit 344a0c91f2
1 changed files with 9 additions and 9 deletions

View File

@ -5,6 +5,7 @@
#include <algorithm> #include <algorithm>
#include <array> #include <array>
#include <memory> #include <memory>
#include <utility>
#include <boost/optional.hpp> #include <boost/optional.hpp>
#include "common/alignment.h" #include "common/alignment.h"
#include "common/math_util.h" #include "common/math_util.h"
@ -176,7 +177,7 @@ private:
class IGBPConnectRequestParcel : public Parcel { class IGBPConnectRequestParcel : public Parcel {
public: public:
explicit IGBPConnectRequestParcel(const std::vector<u8>& buffer) : Parcel(buffer) { explicit IGBPConnectRequestParcel(std::vector<u8> buffer) : Parcel(std::move(buffer)) {
Deserialize(); Deserialize();
} }
~IGBPConnectRequestParcel() override = default; ~IGBPConnectRequestParcel() override = default;
@ -223,8 +224,8 @@ private:
class IGBPSetPreallocatedBufferRequestParcel : public Parcel { class IGBPSetPreallocatedBufferRequestParcel : public Parcel {
public: public:
explicit IGBPSetPreallocatedBufferRequestParcel(const std::vector<u8>& buffer) explicit IGBPSetPreallocatedBufferRequestParcel(std::vector<u8> buffer)
: Parcel(buffer) { : Parcel(std::move(buffer)) {
Deserialize(); Deserialize();
} }
~IGBPSetPreallocatedBufferRequestParcel() override = default; ~IGBPSetPreallocatedBufferRequestParcel() override = default;
@ -256,7 +257,7 @@ protected:
class IGBPDequeueBufferRequestParcel : public Parcel { class IGBPDequeueBufferRequestParcel : public Parcel {
public: public:
explicit IGBPDequeueBufferRequestParcel(const std::vector<u8>& buffer) : Parcel(buffer) { explicit IGBPDequeueBufferRequestParcel(std::vector<u8> buffer) : Parcel(std::move(buffer)) {
Deserialize(); Deserialize();
} }
~IGBPDequeueBufferRequestParcel() override = default; ~IGBPDequeueBufferRequestParcel() override = default;
@ -307,7 +308,7 @@ protected:
class IGBPRequestBufferRequestParcel : public Parcel { class IGBPRequestBufferRequestParcel : public Parcel {
public: public:
explicit IGBPRequestBufferRequestParcel(const std::vector<u8>& buffer) : Parcel(buffer) { explicit IGBPRequestBufferRequestParcel(std::vector<u8> buffer) : Parcel(std::move(buffer)) {
Deserialize(); Deserialize();
} }
~IGBPRequestBufferRequestParcel() override = default; ~IGBPRequestBufferRequestParcel() override = default;
@ -322,8 +323,7 @@ public:
class IGBPRequestBufferResponseParcel : public Parcel { class IGBPRequestBufferResponseParcel : public Parcel {
public: public:
explicit IGBPRequestBufferResponseParcel(NVFlinger::IGBPBuffer buffer) explicit IGBPRequestBufferResponseParcel(NVFlinger::IGBPBuffer buffer) : buffer(buffer) {}
: Parcel(), buffer(buffer) {}
~IGBPRequestBufferResponseParcel() override = default; ~IGBPRequestBufferResponseParcel() override = default;
protected: protected:
@ -340,7 +340,7 @@ protected:
class IGBPQueueBufferRequestParcel : public Parcel { class IGBPQueueBufferRequestParcel : public Parcel {
public: public:
explicit IGBPQueueBufferRequestParcel(const std::vector<u8>& buffer) : Parcel(buffer) { explicit IGBPQueueBufferRequestParcel(std::vector<u8> buffer) : Parcel(std::move(buffer)) {
Deserialize(); Deserialize();
} }
~IGBPQueueBufferRequestParcel() override = default; ~IGBPQueueBufferRequestParcel() override = default;
@ -409,7 +409,7 @@ private:
class IGBPQueryRequestParcel : public Parcel { class IGBPQueryRequestParcel : public Parcel {
public: public:
explicit IGBPQueryRequestParcel(const std::vector<u8>& buffer) : Parcel(buffer) { explicit IGBPQueryRequestParcel(std::vector<u8> buffer) : Parcel(std::move(buffer)) {
Deserialize(); Deserialize();
} }
~IGBPQueryRequestParcel() override = default; ~IGBPQueryRequestParcel() override = default;