mirror of https://github.com/Icinga/icinga2.git
Merge pull request #9555 from Icinga/ApplyRule-GetDebugInfo
ApplyRule#GetDebugInfo(): return by const ref to avoid malloc()
This commit is contained in:
commit
a958a735d7
|
@ -47,7 +47,7 @@ bool ApplyRule::GetIgnoreOnError() const
|
|||
return m_IgnoreOnError;
|
||||
}
|
||||
|
||||
DebugInfo ApplyRule::GetDebugInfo() const
|
||||
const DebugInfo& ApplyRule::GetDebugInfo() const
|
||||
{
|
||||
return m_DebugInfo;
|
||||
}
|
||||
|
|
|
@ -68,7 +68,7 @@ public:
|
|||
|
||||
Expression::Ptr GetFTerm() const;
|
||||
bool GetIgnoreOnError() const;
|
||||
DebugInfo GetDebugInfo() const;
|
||||
const DebugInfo& GetDebugInfo() const;
|
||||
Dictionary::Ptr GetScope() const;
|
||||
void AddMatch();
|
||||
bool HasMatches() const;
|
||||
|
|
|
@ -22,7 +22,7 @@ bool Dependency::EvaluateApplyRuleInstance(const Checkable::Ptr& checkable, cons
|
|||
if (!skipFilter && !rule.EvaluateFilter(frame))
|
||||
return false;
|
||||
|
||||
DebugInfo di = rule.GetDebugInfo();
|
||||
auto& di (rule.GetDebugInfo());
|
||||
|
||||
#ifdef _DEBUG
|
||||
Log(LogDebug, "Dependency")
|
||||
|
@ -64,7 +64,7 @@ bool Dependency::EvaluateApplyRuleInstance(const Checkable::Ptr& checkable, cons
|
|||
|
||||
bool Dependency::EvaluateApplyRule(const Checkable::Ptr& checkable, const ApplyRule& rule, bool skipFilter)
|
||||
{
|
||||
DebugInfo di = rule.GetDebugInfo();
|
||||
auto& di (rule.GetDebugInfo());
|
||||
|
||||
std::ostringstream msgbuf;
|
||||
msgbuf << "Evaluating 'apply' rule (" << di << ")";
|
||||
|
|
|
@ -22,7 +22,7 @@ bool Notification::EvaluateApplyRuleInstance(const Checkable::Ptr& checkable, co
|
|||
if (!skipFilter && !rule.EvaluateFilter(frame))
|
||||
return false;
|
||||
|
||||
DebugInfo di = rule.GetDebugInfo();
|
||||
auto& di (rule.GetDebugInfo());
|
||||
|
||||
#ifdef _DEBUG
|
||||
Log(LogDebug, "Notification")
|
||||
|
@ -63,7 +63,7 @@ bool Notification::EvaluateApplyRuleInstance(const Checkable::Ptr& checkable, co
|
|||
|
||||
bool Notification::EvaluateApplyRule(const Checkable::Ptr& checkable, const ApplyRule& rule, bool skipFilter)
|
||||
{
|
||||
DebugInfo di = rule.GetDebugInfo();
|
||||
auto& di (rule.GetDebugInfo());
|
||||
|
||||
std::ostringstream msgbuf;
|
||||
msgbuf << "Evaluating 'apply' rule (" << di << ")";
|
||||
|
|
|
@ -21,7 +21,7 @@ bool ScheduledDowntime::EvaluateApplyRuleInstance(const Checkable::Ptr& checkabl
|
|||
if (!skipFilter && !rule.EvaluateFilter(frame))
|
||||
return false;
|
||||
|
||||
DebugInfo di = rule.GetDebugInfo();
|
||||
auto& di (rule.GetDebugInfo());
|
||||
|
||||
#ifdef _DEBUG
|
||||
Log(LogDebug, "ScheduledDowntime")
|
||||
|
@ -62,7 +62,7 @@ bool ScheduledDowntime::EvaluateApplyRuleInstance(const Checkable::Ptr& checkabl
|
|||
|
||||
bool ScheduledDowntime::EvaluateApplyRule(const Checkable::Ptr& checkable, const ApplyRule& rule, bool skipFilter)
|
||||
{
|
||||
DebugInfo di = rule.GetDebugInfo();
|
||||
auto& di (rule.GetDebugInfo());
|
||||
|
||||
std::ostringstream msgbuf;
|
||||
msgbuf << "Evaluating 'apply' rule (" << di << ")";
|
||||
|
|
|
@ -21,7 +21,7 @@ bool Service::EvaluateApplyRuleInstance(const Host::Ptr& host, const String& nam
|
|||
if (!skipFilter && !rule.EvaluateFilter(frame))
|
||||
return false;
|
||||
|
||||
DebugInfo di = rule.GetDebugInfo();
|
||||
auto& di (rule.GetDebugInfo());
|
||||
|
||||
#ifdef _DEBUG
|
||||
Log(LogDebug, "Service")
|
||||
|
@ -57,7 +57,7 @@ bool Service::EvaluateApplyRuleInstance(const Host::Ptr& host, const String& nam
|
|||
|
||||
bool Service::EvaluateApplyRule(const Host::Ptr& host, const ApplyRule& rule, bool skipFilter)
|
||||
{
|
||||
DebugInfo di = rule.GetDebugInfo();
|
||||
auto& di (rule.GetDebugInfo());
|
||||
|
||||
std::ostringstream msgbuf;
|
||||
msgbuf << "Evaluating 'apply' rule (" << di << ")";
|
||||
|
|
Loading…
Reference in New Issue