From 3000867527da889b7569dfa6e17297ecdcd1e58f Mon Sep 17 00:00:00 2001 From: liranmauda Date: Thu, 7 Nov 2024 08:31:24 +0200 Subject: [PATCH] Removing `unique` and the unused `NAN_SET_BUF_DETACH` `unique` was removed from `shared_ptr` This PR removes `unique` and the unused `NAN_SET_BUF_DETACH` Signed-off-by: liranmauda (cherry picked from commit 0215f392174253bfbfc334cd043c8f85001a3aef) --- src/native/util/buf.h | 6 ------ src/native/util/nan.h | 6 ------ 2 files changed, 12 deletions(-) diff --git a/src/native/util/buf.h b/src/native/util/buf.h index 713a2fd49e..a2adf02145 100644 --- a/src/native/util/buf.h +++ b/src/native/util/buf.h @@ -167,12 +167,6 @@ class Buf return _alloc->detach(); } - inline bool - unique_alloc() - { - return _alloc.unique(); - } - inline bool same(const Buf& buf) const { diff --git a/src/native/util/nan.h b/src/native/util/nan.h index 78961ad55f..b86559d617 100644 --- a/src/native/util/nan.h +++ b/src/native/util/nan.h @@ -71,12 +71,6 @@ NanKey(std::string s) #define NAN_SET_NUM(obj, key, val) (NAN_SET(obj, key, Nan::New(val))) #define NAN_SET_BUF_COPY(obj, key, buf) \ (NAN_SET(obj, key, Nan::CopyBuffer(buf.cdata(), buf.length()).ToLocalChecked())) -#define NAN_SET_BUF_DETACH(obj, key, buf) \ - do { \ - assert(buf.unique_alloc()); \ - NAN_SET(obj, key, Nan::NewBuffer(buf.cdata(), buf.length()).ToLocalChecked()); \ - buf.detach_alloc(); \ - } while (0) #define NAN_ERR(msg) (Nan::To(Nan::Error(msg)).ToLocalChecked()) #define NAN_RETURN(val) \