{
// Delete the oldest entry if there are more than max(MaxUpdatesWithinInterval,MaxEqualUpdatesInSuccession)+1 entries in the list.
if ( LastUpdates.size() > (size_t)(maximum+1) )
- LastUpdates.erase(LastUpdates.upper_bound(0));
+ LastUpdates.erase(LastUpdates.begin());
return;
}
// UpdateInterval given in service config, then use this to check for expired entries.
else if ( UpdateInterval > 0 )
{
// Delete the oldest entry if it's older than current_time - UpdateInterval(minutes) + 1.
- if ( (current_time - ((time_t)UpdateInterval*60) + 1) > LastUpdates.upper_bound(0)->first )
- LastUpdates.erase(LastUpdates.upper_bound(0));
+ if ( (current_time - ((time_t)UpdateInterval*60) + 1) > LastUpdates.begin()->first )
+ LastUpdates.erase(LastUpdates.begin());
return;
}
// Neither MaxUpdatesWithinInterval nor UpdateInterval are given, so keep fix number of 10 entries.
else
{
if ( LastUpdates.size() > 10 )
- LastUpdates.erase(LastUpdates.upper_bound(0));
+ LastUpdates.erase(LastUpdates.begin());
return;
}
}