Merge pull request #9106 from Icinga/feature/avoid-copy-in-downtimes-timer

Downtime::DowntimesExpireTimerHandler: don't copy vector
This commit is contained in:
Alexander Aleksandrovič Klimov 2021-12-02 15:32:00 +01:00 committed by GitHub
commit 978a72afa2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 6 deletions

View File

@ -482,13 +482,7 @@ void Downtime::DowntimesStartTimerHandler()
void Downtime::DowntimesExpireTimerHandler()
{
std::vector<Downtime::Ptr> downtimes;
for (const Downtime::Ptr& downtime : ConfigType::GetObjectsByType<Downtime>()) {
downtimes.push_back(downtime);
}
for (const Downtime::Ptr& downtime : downtimes) {
/* Only remove downtimes which are activated after daemon start. */
if (downtime->IsActive() && (downtime->IsExpired() || !downtime->HasValidConfigOwner()))
RemoveDowntime(downtime->GetName(), false, false, true);