diff options
author | Tom Tromey <tom@tromey.com> | 2021-12-03 14:45:37 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2021-12-08 13:20:30 -0700 |
commit | 696d6f4d5c1bc9b36d0402c2393efe62e49392d9 (patch) | |
tree | e0a5c7edfce36b065afc1f443a15906936c44660 /gdb/symtab.c | |
parent | 621f8c42d3df079ca5781cdb0925c5ec3498f59c (diff) | |
download | fsf-binutils-gdb-696d6f4d5c1bc9b36d0402c2393efe62e49392d9.zip fsf-binutils-gdb-696d6f4d5c1bc9b36d0402c2393efe62e49392d9.tar.gz fsf-binutils-gdb-696d6f4d5c1bc9b36d0402c2393efe62e49392d9.tar.bz2 |
Use for-each more in gdb
There are some loops in gdb that use ARRAY_SIZE (or a wordier
equivalent) to loop over a static array. This patch changes some of
these to use foreach instead.
Regression tested on x86-64 Fedora 34.
Diffstat (limited to 'gdb/symtab.c')
-rw-r--r-- | gdb/symtab.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/gdb/symtab.c b/gdb/symtab.c index 68b6267..d38628f 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -6375,13 +6375,12 @@ producer_is_realview (const char *producer) "ARM/Thumb C/C++ Compiler, RVCT", "ARM C/C++ Compiler, RVCT" }; - int i; if (producer == NULL) return false; - for (i = 0; i < ARRAY_SIZE (arm_idents); i++) - if (startswith (producer, arm_idents[i])) + for (const char *ident : arm_idents) + if (startswith (producer, ident)) return true; return false; |