1
0
Fork 0

raw bytes don't need to be a pointer

This commit is contained in:
Kevin Matz 2021-08-22 17:41:12 -04:00
parent cc40307adb
commit b147ca0578
2 changed files with 1 additions and 13 deletions

View File

@ -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

View File

@ -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_;