mirror of https://github.com/Icinga/icinga2.git
ApplyRule#GetDebugInfo(): return by const ref to avoid malloc()
This commit is contained in:
parent
dd7009dc63
commit
27a559c5fe
|
@ -61,7 +61,7 @@ bool ApplyRule::GetIgnoreOnError() const
|
|||
return m_IgnoreOnError;
|
||||
}
|
||||
|
||||
DebugInfo ApplyRule::GetDebugInfo() const
|
||||
const DebugInfo& ApplyRule::GetDebugInfo() const
|
||||
{
|
||||
return m_DebugInfo;
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ public:
|
|||
String GetFVVar() const;
|
||||
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 (!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)
|
||||
{
|
||||
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 (!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)
|
||||
{
|
||||
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 (!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)
|
||||
{
|
||||
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 (!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)
|
||||
{
|
||||
DebugInfo di = rule.GetDebugInfo();
|
||||
auto& di (rule.GetDebugInfo());
|
||||
|
||||
std::ostringstream msgbuf;
|
||||
msgbuf << "Evaluating 'apply' rule (" << di << ")";
|
||||
|
|
Loading…
Reference in New Issue