Skip to content

Commit

Permalink
Removing unique and the unused NAN_SET_BUF_DETACH
Browse files Browse the repository at this point in the history
`unique` was removed from `shared_ptr`
This PR removes `unique` and the unused `NAN_SET_BUF_DETACH`

Signed-off-by: liranmauda <[email protected]>
(cherry picked from commit 0215f39)
  • Loading branch information
liranmauda authored and shirady committed Nov 28, 2024
1 parent 07bb564 commit 3000867
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
6 changes: 0 additions & 6 deletions src/native/util/buf.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,6 @@ class Buf
return _alloc->detach();
}

inline bool
unique_alloc()
{
return _alloc.unique();
}

inline bool
same(const Buf& buf) const
{
Expand Down
6 changes: 0 additions & 6 deletions src/native/util/nan.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,6 @@ NanKey(std::string s)
#define NAN_SET_NUM(obj, key, val) (NAN_SET(obj, key, Nan::New<v8::Number>(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<v8::Object>(Nan::Error(msg)).ToLocalChecked())
#define NAN_RETURN(val) \
Expand Down

0 comments on commit 3000867

Please sign in to comment.