mirror of
https://github.com/Icinga/icinga2.git
synced 2026-02-20 00:10:29 -05:00
Downtime::DowntimesExpireTimerHandler: don't copy vector
`ConfigType::GetObjectsByType<Downtime>()` already returns a `std::vector<Downtime::Ptr>` so there is no point in copying it into another vector of the same type just to then iterate the copied vector instead of the original one.
This commit is contained in:
parent
d6a1757cb8
commit
596fcdc123
1 changed files with 0 additions and 6 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue