Merge pull request #9558 from Icinga/context-evaluating-apply-rules-for-host-213

Construct string once, not unnecessarily N times
This commit is contained in:
Julian Brost 2022-11-02 10:48:57 +01:00 committed by GitHub
commit cdd531445a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -121,9 +121,9 @@ bool Service::EvaluateApplyRule(const Host::Ptr& host, const ApplyRule& rule)
void Service::EvaluateApplyRules(const Host::Ptr& host)
{
for (ApplyRule& rule : ApplyRule::GetRules("Service")) {
CONTEXT("Evaluating 'apply' rules for host '" + host->GetName() + "'");
CONTEXT("Evaluating 'apply' rules for host '" + host->GetName() + "'");
for (ApplyRule& rule : ApplyRule::GetRules("Service")) {
if (EvaluateApplyRule(host, rule))
rule.AddMatch();
}