Skip to content

Commit 17f7dcb

Browse files
committed
Remove unneeded operator= overloads
1 parent 04d3517 commit 17f7dcb

File tree

3 files changed

+3
-27
lines changed

3 files changed

+3
-27
lines changed

collector/lib/CollectorOutput.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include "internalapi/sensor/collector_iservice.pb.h"
55

66
#include "GRPCUtil.h"
7+
#include "HostInfo.h"
78

89
namespace collector {
910

@@ -97,7 +98,7 @@ void CollectorOutput::Register() {
9798
sensor::MsgFromCollector msg;
9899
msg.clear_info();
99100
msg.clear_process_signal();
100-
msg.mutable_register_()->set_hostname(GetHostname());
101+
msg.mutable_register_()->set_hostname(HostInfo::GetHostname());
101102

102103
for (const auto& client : sensor_clients_) {
103104
auto res = client->SendMsg(msg);

collector/lib/system-inspector/Service.cpp

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -33,31 +33,7 @@
3333

3434
namespace collector::system_inspector {
3535

36-
Service::Service() = default;
3736
Service::~Service() = default;
38-
Service& Service::operator=(Service&& other) noexcept {
39-
{
40-
auto other_sinsp_lock = std::lock_guard<std::mutex>(other.libsinsp_mutex_);
41-
auto this_sinsp_lock = std::lock_guard<std::mutex>(libsinsp_mutex_);
42-
43-
inspector_.swap(other.inspector_);
44-
container_metadata_inspector_.swap(other.container_metadata_inspector_);
45-
default_formatter_.swap(other.default_formatter_);
46-
}
47-
48-
signal_handlers_.swap(other.signal_handlers_);
49-
50-
userspace_stats_ = other.userspace_stats_;
51-
global_event_filter_ = other.global_event_filter_;
52-
53-
{
54-
auto other_running_lock = std::lock_guard<std::mutex>(other.running_mutex_);
55-
auto this_running_lock = std::lock_guard<std::mutex>(running_mutex_);
56-
std::swap(running_, other.running_);
57-
}
58-
59-
return *this;
60-
}
6137

6238
Service::Service(const CollectorConfig& config, CollectorOutput* client)
6339
: inspector_(std::make_unique<sinsp>(true)),

collector/lib/system-inspector/Service.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,10 @@ namespace collector::system_inspector {
2424

2525
class Service : public SystemInspector {
2626
public:
27-
Service();
2827
Service(const Service&) = delete;
2928
Service(Service&&) = delete;
3029
Service& operator=(const Service&) = delete;
31-
Service& operator=(Service&&) noexcept;
30+
Service& operator=(Service&&) = delete;
3231
~Service() override;
3332

3433
Service(const CollectorConfig& config, CollectorOutput* client);

0 commit comments

Comments
 (0)