Module: check_mk
Branch: master
Commit: eab5164e76dc5ea67a94485fc51141470b27216e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=eab5164e76dc5e…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Wed Apr 10 15:01:50 2019 +0200
Copy arguments, simplifying things later.
Change-Id: I99598934700c1317bd1e3a1a01c1a8a81617beb2
---
livestatus/src/Logfile.cc | 1 -
livestatus/src/NagiosCore.cc | 6 +++---
livestatus/src/NagiosCore.h | 11 +++++------
livestatus/src/Query.cc | 1 -
4 files changed, 8 insertions(+), 11 deletions(-)
diff --git a/livestatus/src/Logfile.cc b/livestatus/src/Logfile.cc
index 7251a1c..a26e2f4 100644
--- a/livestatus/src/Logfile.cc
+++ b/livestatus/src/Logfile.cc
@@ -196,4 +196,3 @@ const logfile_entries_t *Logfile::getEntriesFor(size_t
max_lines_per_logfile,
uint64_t Logfile::makeKey(time_t t, size_t lineno) {
return (static_cast<uint64_t>(t) << 32) |
static_cast<uint64_t>(lineno);
}
-
diff --git a/livestatus/src/NagiosCore.cc b/livestatus/src/NagiosCore.cc
index 52404a8..5507a76 100644
--- a/livestatus/src/NagiosCore.cc
+++ b/livestatus/src/NagiosCore.cc
@@ -44,11 +44,11 @@ void NagiosPaths::dump(Logger *logger) {
Notice(logger) << "mkeventd socket path = '" <<
_mkeventd_socket << "'";
}
-NagiosCore::NagiosCore(const NagiosPaths &paths, const NagiosLimits &limits,
- const NagiosAuthorization &authorization,
+NagiosCore::NagiosCore(NagiosPaths paths, NagiosLimits limits,
+ NagiosAuthorization authorization,
Encoding data_encoding)
: _logger_livestatus(Logger::getLogger("cmk.livestatus"))
- , _paths(paths)
+ , _paths(std::move(paths))
, _limits(limits)
, _authorization(authorization)
, _data_encoding(data_encoding)
diff --git a/livestatus/src/NagiosCore.h b/livestatus/src/NagiosCore.h
index ea11d70..bc7daf9 100644
--- a/livestatus/src/NagiosCore.h
+++ b/livestatus/src/NagiosCore.h
@@ -67,9 +67,8 @@ struct NagiosAuthorization {
class NagiosCore : public MonitoringCore {
public:
- NagiosCore(const NagiosPaths &paths, const NagiosLimits &limits,
- const NagiosAuthorization &authorization,
- Encoding data_encoding);
+ NagiosCore(NagiosPaths paths, NagiosLimits limits,
+ NagiosAuthorization authorization, Encoding data_encoding);
Host *find_host(const std::string &name) override;
Host *getHostByDesignation(const std::string &designation) override;
@@ -133,9 +132,9 @@ public:
private:
Logger *_logger_livestatus;
- const NagiosPaths &_paths;
- const NagiosLimits &_limits;
- const NagiosAuthorization &_authorization;
+ const NagiosPaths _paths;
+ const NagiosLimits _limits;
+ const NagiosAuthorization _authorization;
Encoding _data_encoding;
Store _store;
std::unordered_map<std::string, host *> _hosts_by_designation;
diff --git a/livestatus/src/Query.cc b/livestatus/src/Query.cc
index f32f53e..cd45bcf 100644
--- a/livestatus/src/Query.cc
+++ b/livestatus/src/Query.cc
@@ -807,4 +807,3 @@ void Query::doWait() {
timezoneOffset());
});
}
-