From 1c49bb455c2b401b508b3f3d5924ba461e153ad4 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Thu, 19 Jan 2023 20:14:25 -0700 Subject: Convert explicit iterator uses to foreach This converts most existing explicit uses of block_iterator to use foreach with the range iterator instead. --- gdb/guile/scm-block.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'gdb/guile') diff --git a/gdb/guile/scm-block.c b/gdb/guile/scm-block.c index c9d847a..02b7a48 100644 --- a/gdb/guile/scm-block.c +++ b/gdb/guile/scm-block.c @@ -501,20 +501,15 @@ gdbscm_block_symbols (SCM self) block_smob *b_smob = bkscm_get_valid_block_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME); const struct block *block = b_smob->block; - struct block_iterator iter; - struct symbol *sym; SCM result; result = SCM_EOL; - sym = block_iterator_first (block, &iter); - - while (sym != NULL) + for (struct symbol *sym : block_iterator_range (block)) { SCM s_scm = syscm_scm_from_symbol (sym); result = scm_cons (s_scm, result); - sym = block_iterator_next (&iter); } return scm_reverse_x (result, SCM_EOL); -- cgit v1.1