Module: check_mk
Branch: master
Commit: 05dca9e1e19f90f2d2592d12b22548077f768eeb
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=05dca9e1e19f90…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Mon Feb 25 11:03:25 2019 +0100
Avoid useless string copy.
Change-Id: Ifc5047b349d550674f54c379ae964d22c4e8aa71
---
livestatus/src/MonitoringCore.h | 2 +-
livestatus/src/module.cc | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/livestatus/src/MonitoringCore.h b/livestatus/src/MonitoringCore.h
index 2656884..5f91f3c 100644
--- a/livestatus/src/MonitoringCore.h
+++ b/livestatus/src/MonitoringCore.h
@@ -82,7 +82,7 @@ public:
virtual std::chrono::system_clock::time_point last_logfile_rotation() = 0;
virtual size_t maxLinesPerLogFile() const = 0;
- virtual Command find_command(std::string name) const = 0;
+ virtual Command find_command(const std::string &name) const = 0;
virtual std::vector<Command> commands() const = 0;
virtual std::vector<DowntimeData> downtimes_for_host(
diff --git a/livestatus/src/module.cc b/livestatus/src/module.cc
index ceeb3e5..d5ce4e7 100644
--- a/livestatus/src/module.cc
+++ b/livestatus/src/module.cc
@@ -596,7 +596,7 @@ public:
return std::chrono::system_clock::from_time_t(last_log_rotation);
}
- Command find_command(std::string name) const override {
+ Command find_command(const std::string &name) const override {
// Older Nagios headers are not const-correct... :-P
if (command *cmd = ::find_command(const_cast<char *>(name.c_str()))) {
return {cmd->name, cmd->command_line};