raw bytes don't need to be a pointer
This commit is contained in:
parent
cc40307adb
commit
b147ca0578
|
@ -35,7 +35,6 @@ namespace UUID {
|
|||
* @brief uuid::uuid
|
||||
*/
|
||||
uuid::uuid()
|
||||
: raw_(new uint8_t[UUID_LENGTH])
|
||||
{
|
||||
type_ = NIL;
|
||||
version_ = VOID;
|
||||
|
@ -51,7 +50,6 @@ uuid::uuid()
|
|||
* @param other
|
||||
*/
|
||||
uuid::uuid(const uuid& other)
|
||||
: raw_(new uint8_t[UUID_LENGTH])
|
||||
{
|
||||
type_ = other.type_;
|
||||
version_ = other.version_;
|
||||
|
@ -62,15 +60,6 @@ uuid::uuid(const uuid& other)
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief uuid::~uuid
|
||||
*/
|
||||
uuid::~uuid()
|
||||
{
|
||||
delete[] raw_;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief uuid::fromArray
|
||||
* @param bytes
|
||||
|
|
|
@ -115,7 +115,6 @@ public:
|
|||
uuid(const uint8_t * raw) : uuid() { fromArray_(raw); };
|
||||
uuid(const char * c_str) : uuid() { fromCstring_(c_str); };
|
||||
uuid(std::string str) : uuid() { fromString_(str); };
|
||||
~uuid();
|
||||
|
||||
// accessors
|
||||
const uint8_t * bytes() const { return raw_; };
|
||||
|
@ -146,7 +145,7 @@ public:
|
|||
operator const std::string () const { return string(); };
|
||||
|
||||
private:
|
||||
uint8_t* raw_;
|
||||
uint8_t raw_[UUID_LENGTH] = {0};
|
||||
Type type_;
|
||||
uint16_t version_;
|
||||
uint64_t timestamp_;
|
||||
|
|
Loading…
Reference in New Issue