From 5532aca9169728a459fedac1b18aae73dc9c1d37 Mon Sep 17 00:00:00 2001
From: Slava Semushin <php-coder@altlinux.ru>
Date: Tue, 3 Mar 2009 17:55:04 +0600
Subject: src/Keys.cc(deleteTree): use FbTk::STLUtil::destroyAndClearSecond()
 instead of self-written code.

No functional change.

Signed-off-by: Slava Semushin <php-coder@altlinux.ru>
---
 src/Keys.cc | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/Keys.cc b/src/Keys.cc
index ac25588..794aad4 100644
--- a/src/Keys.cc
+++ b/src/Keys.cc
@@ -35,6 +35,7 @@
 #include "FbTk/CommandParser.hh"
 #include "FbTk/I18n.hh"
 #include "FbTk/AutoReloadHelper.hh"
+#include "FbTk/STLUtil.hh"
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -102,6 +103,8 @@ using std::vector;
 using std::ifstream;
 using std::pair;
 
+using FbTk::STLUtil::destroyAndClearSecond;
+
 // helper class 'keytree'
 class Keys::t_key {
 public:
@@ -185,9 +188,8 @@ Keys::~Keys() {
 
 /// Destroys the keytree
 void Keys::deleteTree() {
-    for (keyspace_t::iterator map_it = m_map.begin(); map_it != m_map.end(); ++map_it)
-        delete map_it->second;
-    m_map.clear();
+
+    destroyAndClearSecond(m_map);
     next_key = 0;
     saved_keymode = 0;
 }
-- 
cgit v0.11.2