aboutsummaryrefslogtreecommitdiff
path: root/gdb/cp-support.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2021-12-03 14:45:37 -0700
committerTom Tromey <tom@tromey.com>2021-12-08 13:20:30 -0700
commit696d6f4d5c1bc9b36d0402c2393efe62e49392d9 (patch)
treee0a5c7edfce36b065afc1f443a15906936c44660 /gdb/cp-support.c
parent621f8c42d3df079ca5781cdb0925c5ec3498f59c (diff)
downloadgdb-696d6f4d5c1bc9b36d0402c2393efe62e49392d9.zip
gdb-696d6f4d5c1bc9b36d0402c2393efe62e49392d9.tar.gz
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/cp-support.c')
-rw-r--r--gdb/cp-support.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/cp-support.c b/gdb/cp-support.c
index 367fb6a..0e506f5 100644
--- a/gdb/cp-support.c
+++ b/gdb/cp-support.c
@@ -147,9 +147,9 @@ inspect_type (struct demangle_parse_info *info,
name[ret_comp->u.s_name.len] = '\0';
/* Ignore any typedefs that should not be substituted. */
- for (int i = 0; i < ARRAY_SIZE (ignore_typedefs); ++i)
+ for (const char *ignorable : ignore_typedefs)
{
- if (strcmp (name, ignore_typedefs[i]) == 0)
+ if (strcmp (name, ignorable) == 0)
return 0;
}