mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2025-07-03 08:15:35 +00:00
Use of std::move and added DEBUG ifdef
This commit is contained in:
parent
3bc8744b63
commit
7410e31230
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
class TVehicleData final {
|
class TVehicleData final {
|
||||||
public:
|
public:
|
||||||
TVehicleData(int ID, const std::string& Data);
|
TVehicleData(int ID, std::string Data);
|
||||||
~TVehicleData();
|
~TVehicleData();
|
||||||
|
|
||||||
[[nodiscard]] bool IsInvalid() const { return mID == -1; }
|
[[nodiscard]] bool IsInvalid() const { return mID == -1; }
|
||||||
|
@ -1,12 +1,18 @@
|
|||||||
#include "VehicleData.h"
|
#include "VehicleData.h"
|
||||||
|
|
||||||
|
#include <utility>
|
||||||
#include "Common.h"
|
#include "Common.h"
|
||||||
|
|
||||||
TVehicleData::TVehicleData(int ID, const std::string& Data)
|
TVehicleData::TVehicleData(int ID, std::string Data)
|
||||||
: mID(ID)
|
: mID(ID)
|
||||||
, mData(Data) {
|
, mData(std::move(Data)) {
|
||||||
|
#ifdef DEBUG
|
||||||
debug("vehicle " + std::to_string(mID) + " constructed");
|
debug("vehicle " + std::to_string(mID) + " constructed");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
TVehicleData::~TVehicleData() {
|
TVehicleData::~TVehicleData() {
|
||||||
|
#ifdef DEBUG
|
||||||
debug("vehicle " + std::to_string(mID) + " destroyed");
|
debug("vehicle " + std::to_string(mID) + " destroyed");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user