Skip to content

Commit

Permalink
src: mark empty destructors as default
Browse files Browse the repository at this point in the history
Mark empty destructors as having a default no-op implementation.
Remove a few unused constructors and destructors while we are here.
  • Loading branch information
bnoordhuis committed Oct 23, 2014
1 parent c038dcc commit 5ab87db
Show file tree
Hide file tree
Showing 11 changed files with 4 additions and 28 deletions.
3 changes: 0 additions & 3 deletions src/async-wrap-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ inline AsyncWrap::AsyncWrap(Environment* env,
}


inline AsyncWrap::~AsyncWrap() {
}

inline uint32_t AsyncWrap::provider_type() const {
return provider_type_;
}
Expand Down
2 changes: 1 addition & 1 deletion src/async-wrap.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class AsyncWrap : public BaseObject {
v8::Handle<v8::Object> object,
ProviderType provider);

inline ~AsyncWrap();
inline ~AsyncWrap() = default;

inline bool has_async_listener();

Expand Down
4 changes: 2 additions & 2 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,12 @@ class ArrayBufferAllocator : public ArrayBuffer::Allocator {
// the process.
static const size_t kMaxLength = 0x3fffffff;
static ArrayBufferAllocator the_singleton;
virtual ~ArrayBufferAllocator() {}
virtual ~ArrayBufferAllocator() = default;
virtual void* Allocate(size_t length) override;
virtual void* AllocateUninitialized(size_t length) override;
virtual void Free(void* data, size_t length) override;
private:
ArrayBufferAllocator() {}
ArrayBufferAllocator() = default;
DISALLOW_COPY_AND_ASSIGN(ArrayBufferAllocator);
};

Expand Down
3 changes: 0 additions & 3 deletions src/node_crypto_clienthello.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ class ClientHelloParser {

class ClientHello {
public:
ClientHello() {
}

inline uint8_t session_size() const { return session_size_; }
inline const uint8_t* session_id() const { return session_id_; }
inline bool has_ticket() const { return has_ticket_; }
Expand Down
3 changes: 0 additions & 3 deletions src/node_v8_platform.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ using v8::Isolate;
// The last task to encounter before killing the worker
class StopTask : public Task {
public:
StopTask() {}
~StopTask() {}

void Run() {}
};

Expand Down
3 changes: 0 additions & 3 deletions src/process_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,6 @@ class ProcessWrap : public HandleWrap {
AsyncWrap::PROVIDER_PROCESSWRAP) {
}

~ProcessWrap() {
}

static void ParseStdioOptions(Environment* env,
Local<Object> js_options,
uv_process_options_t* options) {
Expand Down
3 changes: 0 additions & 3 deletions src/signal_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,6 @@ class SignalWrap : public HandleWrap {
CHECK_EQ(r, 0);
}

~SignalWrap() {
}

static void Start(const FunctionCallbackInfo<Value>& args) {
SignalWrap* wrap = Unwrap<SignalWrap>(args.Holder());
int signum = args[0]->Int32Value();
Expand Down
3 changes: 1 addition & 2 deletions src/stream_wrap.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ class StreamWrapCallbacks {
explicit StreamWrapCallbacks(StreamWrapCallbacks* old) : wrap_(old->wrap()) {
}

virtual ~StreamWrapCallbacks() {
}
virtual ~StreamWrapCallbacks() = default;

virtual const char* Error();

Expand Down
3 changes: 0 additions & 3 deletions src/timer_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,6 @@ class TimerWrap : public HandleWrap {
CHECK_EQ(r, 0);
}

~TimerWrap() {
}

static void Start(const FunctionCallbackInfo<Value>& args) {
TimerWrap* wrap = Unwrap<TimerWrap>(args.Holder());

Expand Down
4 changes: 0 additions & 4 deletions src/udp_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,6 @@ UDPWrap::UDPWrap(Environment* env, Handle<Object> object)
}


UDPWrap::~UDPWrap() {
}


void UDPWrap::Initialize(Handle<Object> target,
Handle<Value> unused,
Handle<Context> context) {
Expand Down
1 change: 0 additions & 1 deletion src/udp_wrap.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ class UDPWrap: public HandleWrap {

private:
UDPWrap(Environment* env, v8::Handle<v8::Object> object);
virtual ~UDPWrap() override;

static void DoBind(const v8::FunctionCallbackInfo<v8::Value>& args,
int family);
Expand Down

0 comments on commit 5ab87db

Please sign in to comment.