Skip to content

Commit 9c217e8

Browse files
CGQAQRafaelGSS
authored andcommitted
src: modernize use-equals-default
PR-URL: #48735 Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
1 parent 22c7c80 commit 9c217e8

11 files changed

+11
-18
lines changed

src/api/environment.cc

-2
Original file line numberDiff line numberDiff line change
@@ -408,8 +408,6 @@ void FreeIsolateData(IsolateData* isolate_data) {
408408
delete isolate_data;
409409
}
410410

411-
InspectorParentHandle::~InspectorParentHandle() {}
412-
413411
// Hide the internal handle class from the public API.
414412
#if HAVE_INSPECTOR
415413
struct InspectorParentHandleImpl : public InspectorParentHandle {

src/blob_serializer_deserializer.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class BlobDeserializer : public BlobSerializerDeserializer {
3939
public:
4040
explicit BlobDeserializer(bool is_debug_v, std::string_view s)
4141
: BlobSerializerDeserializer(is_debug_v), sink(s) {}
42-
~BlobDeserializer() {}
42+
~BlobDeserializer() = default;
4343

4444
size_t read_total = 0;
4545
std::string_view sink;
@@ -85,7 +85,7 @@ class BlobSerializer : public BlobSerializerDeserializer {
8585
public:
8686
explicit BlobSerializer(bool is_debug_v)
8787
: BlobSerializerDeserializer(is_debug_v) {}
88-
~BlobSerializer() {}
88+
~BlobSerializer() = default;
8989

9090
Impl* impl() { return static_cast<Impl*>(this); }
9191
const Impl* impl() const { return static_cast<const Impl*>(this); }

src/cleanup_queue.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class CleanupQueue : public MemoryRetainer {
1818
public:
1919
typedef void (*Callback)(void*);
2020

21-
CleanupQueue() {}
21+
CleanupQueue() = default;
2222

2323
// Not copyable.
2424
CleanupQueue(const CleanupQueue&) = delete;

src/crypto/crypto_ec.cc

-2
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,6 @@ void ECDH::MemoryInfo(MemoryTracker* tracker) const {
130130
tracker->TrackFieldWithSize("key", key_ ? kSizeOf_EC_KEY : 0);
131131
}
132132

133-
ECDH::~ECDH() {}
134-
135133
void ECDH::New(const FunctionCallbackInfo<Value>& args) {
136134
Environment* env = Environment::GetCurrent(args);
137135

src/crypto/crypto_ec.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ int GetOKPCurveFromName(const char* name);
2020

2121
class ECDH final : public BaseObject {
2222
public:
23-
~ECDH() override;
23+
~ECDH() override = default;
2424

2525
static void Initialize(Environment* env, v8::Local<v8::Object> target);
2626
static void RegisterExternalReferences(ExternalReferenceRegistry* registry);

src/inspector_agent.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ Agent::Agent(Environment* env)
687687
debug_options_(env->options()->debug_options()),
688688
host_port_(env->inspector_host_port()) {}
689689

690-
Agent::~Agent() {}
690+
Agent::~Agent() = default;
691691

692692
bool Agent::Start(const std::string& path,
693693
const DebugOptions& options,

src/js_native_api_v8.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ namespace v8impl {
1010

1111
class RefTracker {
1212
public:
13-
RefTracker() {}
14-
virtual ~RefTracker() {}
13+
RefTracker() = default;
14+
virtual ~RefTracker() = default;
1515
virtual void Finalize() {}
1616

1717
typedef RefTracker RefList;

src/json_parser.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace node {
1616
class JSONParser {
1717
public:
1818
JSONParser();
19-
~JSONParser() {}
19+
~JSONParser() = default;
2020
bool Parse(const std::string& content);
2121
std::optional<std::string> GetTopLevelStringField(std::string_view field);
2222
std::optional<bool> GetTopLevelBoolField(std::string_view field);

src/node.cc

-3
Original file line numberDiff line numberDiff line change
@@ -1138,9 +1138,6 @@ void TearDownOncePerProcess() {
11381138
}
11391139
}
11401140

1141-
InitializationResult::~InitializationResult() {}
1142-
InitializationResultImpl::~InitializationResultImpl() {}
1143-
11441141
ExitCode GenerateAndWriteSnapshotData(const SnapshotData** snapshot_data_ptr,
11451142
const InitializationResultImpl* result) {
11461143
ExitCode exit_code = result->exit_code_enum();

src/node.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ enum Flags : uint32_t {
285285

286286
class NODE_EXTERN InitializationResult {
287287
public:
288-
virtual ~InitializationResult();
288+
virtual ~InitializationResult() = default;
289289

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

656656
struct InspectorParentHandle {
657-
virtual ~InspectorParentHandle();
657+
virtual ~InspectorParentHandle() = default;
658658
};
659659

660660
// TODO(addaleax): Maybe move per-Environment options parsing here.

src/node_internals.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ void MarkBootstrapComplete(const v8::FunctionCallbackInfo<v8::Value>& args);
318318

319319
class InitializationResultImpl final : public InitializationResult {
320320
public:
321-
~InitializationResultImpl();
321+
~InitializationResultImpl() = default;
322322
int exit_code() const { return static_cast<int>(exit_code_enum()); }
323323
ExitCode exit_code_enum() const { return exit_code_; }
324324
bool early_return() const { return early_return_; }

0 commit comments

Comments
 (0)