From 7c4e5d5eaad59ac4d9cf06934c953537b0b1a367 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Tue, 4 May 2021 15:26:58 -0600 Subject: libcc1: use foreach This changes libcc1 to ues foreach in a couple of spots. libcc1 * libcp1plugin.cc (plugin_context::mark): Use foreach. * libcc1plugin.cc (plugin_context::mark): Use foreach. --- libcc1/libcp1plugin.cc | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'libcc1/libcp1plugin.cc') diff --git a/libcc1/libcp1plugin.cc b/libcc1/libcp1plugin.cc index 1fc8e269f07..3cbad5c6f02 100644 --- a/libcc1/libcp1plugin.cc +++ b/libcc1/libcp1plugin.cc @@ -225,17 +225,14 @@ plugin_context::plugin_context (int fd) void plugin_context::mark () { - for (hash_table::iterator it = address_map.begin (); - it != address_map.end (); - ++it) + for (const auto &item : address_map) { - ggc_mark ((*it)->decl); - ggc_mark ((*it)->address); + ggc_mark (item->decl); + ggc_mark (item->address); } - for (hash_table< nofree_ptr_hash >::iterator - it = preserved.begin (); it != preserved.end (); ++it) - ggc_mark (&*it); + for (const auto &item : preserved) + ggc_mark (&item); } static void -- cgit v1.2.3