- if ((whowas_fifo.size() > this->MaxGroups) || (whowas_fifo.front().first < min))
- {
- whowas_users::iterator iter = whowas.find(whowas_fifo.front().second);
-
- /* hopefully redundant integrity check, but added while debugging r6216 */
- if (iter == whowas.end())
- {
- /* this should never happen, if it does maps are corrupt */
- ServerInstance->Logs->Log("WHOWAS", LOG_DEFAULT, "BUG: Whowas maps got corrupted! (1)");
- return;
- }
-
- whowas_set* set = iter->second;
- for (whowas_set::iterator i = set->begin(); i != set->end(); ++i)
- delete *i;
-
- delete set;
- whowas.erase(iter);
- whowas_fifo.pop_front();
- }
+ WhoWas::Nick* nick = whowas_fifo.front();
+ if ((whowas_fifo.size() > this->MaxGroups) || (nick->addtime < min))
+ PurgeNick(nick);