From ef0fecc856d435ff140ce87ca38618d6edceafcc Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Mon, 24 Mar 2014 16:50:48 +0100 Subject: Add stdalgo::delete_all() that deletes all elements in a container --- src/coremods/core_whowas.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/coremods') diff --git a/src/coremods/core_whowas.cpp b/src/coremods/core_whowas.cpp index 0a3a994a8..0227fdb51 100644 --- a/src/coremods/core_whowas.cpp +++ b/src/coremods/core_whowas.cpp @@ -119,8 +119,7 @@ void CommandWhowas::AddToWhoWas(User* user) if (it != whowas.end()) { whowas_set* set = it->second; - for (whowas_set::iterator i = set->begin(); i != set->end(); ++i) - delete *i; + stdalgo::delete_all(*set); delete set; whowas.erase(it); @@ -164,8 +163,7 @@ void CommandWhowas::Prune() } whowas_set* set = iter->second; - for (whowas_set::iterator i = set->begin(); i != set->end(); ++i) - delete *i; + stdalgo::delete_all(*set); delete set; whowas.erase(iter); -- cgit v1.2.3