mirror of
https://github.com/Icinga/icinga2.git
synced 2025-04-08 17:05:25 +02: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
@ -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…
x
Reference in New Issue
Block a user