diff options
author | Tom Tromey <tom@tromey.com> | 2023-01-19 20:14:25 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2023-02-19 12:51:06 -0700 |
commit | 1c49bb455c2b401b508b3f3d5924ba461e153ad4 (patch) | |
tree | e89df3f1f33eb458fb41d075ba57a43c5c072ed2 /gdb/guile | |
parent | 0f50815c894bea5d8f7c14b7c1639325bd0b4abb (diff) | |
download | fsf-binutils-gdb-1c49bb455c2b401b508b3f3d5924ba461e153ad4.zip fsf-binutils-gdb-1c49bb455c2b401b508b3f3d5924ba461e153ad4.tar.gz fsf-binutils-gdb-1c49bb455c2b401b508b3f3d5924ba461e153ad4.tar.bz2 |
Convert explicit iterator uses to foreach
This converts most existing explicit uses of block_iterator to use
foreach with the range iterator instead.
Diffstat (limited to 'gdb/guile')
-rw-r--r-- | gdb/guile/scm-block.c | 7 |
1 files changed, 1 insertions, 6 deletions
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); |