Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: modernize use-equals-default #48735

Merged
merged 4 commits into from
Aug 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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() {}
RafaelGSS marked this conversation as resolved.
Show resolved Hide resolved

// 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 @@ -17,7 +17,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 @@ -1127,9 +1127,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