Skip to content

Commit

Permalink
src: modernize use-equals-default
Browse files Browse the repository at this point in the history
PR-URL: #48735
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
  • Loading branch information
CGQAQ authored and RafaelGSS committed Aug 17, 2023
1 parent db4370f commit f126b9e
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 18 deletions.
2 changes: 0 additions & 2 deletions src/api/environment.cc
Original file line number Diff line number Diff line change
Expand Up @@ -408,8 +408,6 @@ void FreeIsolateData(IsolateData* isolate_data) {
delete isolate_data;
}

InspectorParentHandle::~InspectorParentHandle() {}

// Hide the internal handle class from the public API.
#if HAVE_INSPECTOR
struct InspectorParentHandleImpl : public InspectorParentHandle {
Expand Down
4 changes: 2 additions & 2 deletions src/blob_serializer_deserializer.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class BlobDeserializer : public BlobSerializerDeserializer {
public:
explicit BlobDeserializer(bool is_debug_v, std::string_view s)
: BlobSerializerDeserializer(is_debug_v), sink(s) {}
~BlobDeserializer() {}
~BlobDeserializer() = default;

size_t read_total = 0;
std::string_view sink;
Expand Down Expand Up @@ -85,7 +85,7 @@ class BlobSerializer : public BlobSerializerDeserializer {
public:
explicit BlobSerializer(bool is_debug_v)
: BlobSerializerDeserializer(is_debug_v) {}
~BlobSerializer() {}
~BlobSerializer() = default;

Impl* impl() { return static_cast<Impl*>(this); }
const Impl* impl() const { return static_cast<const Impl*>(this); }
Expand Down
2 changes: 1 addition & 1 deletion src/cleanup_queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class CleanupQueue : public MemoryRetainer {
public:
typedef void (*Callback)(void*);

CleanupQueue() {}
CleanupQueue() = default;

// Not copyable.
CleanupQueue(const CleanupQueue&) = delete;
Expand Down
2 changes: 0 additions & 2 deletions src/crypto/crypto_ec.cc
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,6 @@ void ECDH::MemoryInfo(MemoryTracker* tracker) const {
tracker->TrackFieldWithSize("key", key_ ? kSizeOf_EC_KEY : 0);
}

ECDH::~ECDH() {}

void ECDH::New(const FunctionCallbackInfo<Value>& args) {
Environment* env = Environment::GetCurrent(args);

Expand Down
2 changes: 1 addition & 1 deletion src/crypto/crypto_ec.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ int GetOKPCurveFromName(const char* name);

class ECDH final : public BaseObject {
public:
~ECDH() override;
~ECDH() override = default;

static void Initialize(Environment* env, v8::Local<v8::Object> target);
static void RegisterExternalReferences(ExternalReferenceRegistry* registry);
Expand Down
2 changes: 1 addition & 1 deletion src/inspector_agent.cc
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ Agent::Agent(Environment* env)
debug_options_(env->options()->debug_options()),
host_port_(env->inspector_host_port()) {}

Agent::~Agent() {}
Agent::~Agent() = default;

bool Agent::Start(const std::string& path,
const DebugOptions& options,
Expand Down
4 changes: 2 additions & 2 deletions src/js_native_api_v8.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ namespace v8impl {

class RefTracker {
public:
RefTracker() {}
virtual ~RefTracker() {}
RefTracker() = default;
virtual ~RefTracker() = default;
virtual void Finalize() {}

typedef RefTracker RefList;
Expand Down
2 changes: 1 addition & 1 deletion src/json_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace node {
class JSONParser {
public:
JSONParser();
~JSONParser() {}
~JSONParser() = default;
bool Parse(const std::string& content);
std::optional<std::string> GetTopLevelStringField(std::string_view field);
std::optional<bool> GetTopLevelBoolField(std::string_view field);
Expand Down
3 changes: 0 additions & 3 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1138,9 +1138,6 @@ void TearDownOncePerProcess() {
}
}

InitializationResult::~InitializationResult() {}
InitializationResultImpl::~InitializationResultImpl() {}

ExitCode GenerateAndWriteSnapshotData(const SnapshotData** snapshot_data_ptr,
const InitializationResultImpl* result) {
ExitCode exit_code = result->exit_code_enum();
Expand Down
4 changes: 2 additions & 2 deletions src/node.h
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ enum Flags : uint32_t {

class NODE_EXTERN InitializationResult {
public:
virtual ~InitializationResult();
virtual ~InitializationResult() = default;

// Returns a suggested process exit code.
virtual int exit_code() const = 0;
Expand Down Expand Up @@ -654,7 +654,7 @@ enum Flags : uint64_t {
} // namespace EnvironmentFlags

struct InspectorParentHandle {
virtual ~InspectorParentHandle();
virtual ~InspectorParentHandle() = default;
};

// TODO(addaleax): Maybe move per-Environment options parsing here.
Expand Down
2 changes: 1 addition & 1 deletion src/node_internals.h
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ void MarkBootstrapComplete(const v8::FunctionCallbackInfo<v8::Value>& args);

class InitializationResultImpl final : public InitializationResult {
public:
~InitializationResultImpl();
~InitializationResultImpl() = default;
int exit_code() const { return static_cast<int>(exit_code_enum()); }
ExitCode exit_code_enum() const { return exit_code_; }
bool early_return() const { return early_return_; }
Expand Down

0 comments on commit f126b9e

Please sign in to comment.