summaryrefslogtreecommitdiffstats
path: root/dwflpp.cxx
diff options
context:
space:
mode:
authorJosh Stone <jistone@redhat.com>2009-09-09 16:13:16 -0700
committerJosh Stone <jistone@redhat.com>2009-09-10 13:20:36 -0700
commitc9efa5c99498ccb3d2f0f87bc373da7dfd1cc067 (patch)
tree2d8cf0995d76421ac3fbc08f4ee2c43e0fae639f /dwflpp.cxx
parent9aa8ffcea9980d24cc9c9f13d9dd51e46e6283bf (diff)
downloadsystemtap-steved-c9efa5c99498ccb3d2f0f87bc373da7dfd1cc067.tar.gz
systemtap-steved-c9efa5c99498ccb3d2f0f87bc373da7dfd1cc067.tar.xz
systemtap-steved-c9efa5c99498ccb3d2f0f87bc373da7dfd1cc067.zip
Simplify deleting all map values
* util.h (delete_map): New templated map deleter. * dwflpp.cxx (dwflpp::~dwflpp): Use it. * tapsets.cxx (symbol_table::~symbol_table): Use it.
Diffstat (limited to 'dwflpp.cxx')
-rw-r--r--dwflpp.cxx24
1 files changed, 5 insertions, 19 deletions
diff --git a/dwflpp.cxx b/dwflpp.cxx
index d96f3eda..36b016c7 100644
--- a/dwflpp.cxx
+++ b/dwflpp.cxx
@@ -98,25 +98,11 @@ dwflpp::~dwflpp()
{
free(cached_scopes);
- for (module_cu_cache_t::iterator it = module_cu_cache.begin();
- it != module_cu_cache.end(); ++it)
- delete it->second;
-
- for (mod_cu_function_cache_t::iterator it = cu_function_cache.begin();
- it != cu_function_cache.end(); ++it)
- delete it->second;
-
- for (cu_inl_function_cache_t::iterator it = cu_inl_function_cache.begin();
- it != cu_inl_function_cache.end(); ++it)
- delete it->second;
-
- for (mod_cu_type_cache_t::iterator it = global_alias_cache.begin();
- it != global_alias_cache.end(); ++it)
- delete it->second;
-
- for (mod_cu_die_parent_cache_t::iterator it = cu_die_parent_cache.begin();
- it != cu_die_parent_cache.end(); ++it)
- delete it->second;
+ delete_map(module_cu_cache);
+ delete_map(cu_function_cache);
+ delete_map(cu_inl_function_cache);
+ delete_map(global_alias_cache);
+ delete_map(cu_die_parent_cache);
if (dwfl)
dwfl_end(dwfl);