Use htab_up in breakpoint.c

This changes breakpoint.c to use htab_up rather than an explicit
htab_delete.  This simplifies the code somewhat.

gdb/ChangeLog
2020-09-17  Tom Tromey  <tom@tromey.com>

	* breakpoint.c (ambiguous_names_p): Use htab_up.
This commit is contained in:
Tom Tromey 2020-09-17 11:47:50 -06:00
parent 88f07206fa
commit c1fb98360c
2 changed files with 8 additions and 8 deletions

View File

@ -1,3 +1,7 @@
2020-09-17 Tom Tromey <tom@tromey.com>
* breakpoint.c (ambiguous_names_p): Use htab_up.
2020-09-17 Tom Tromey <tom@tromey.com>
* auto-load.c (struct auto_load_pspace_info)

View File

@ -13246,8 +13246,8 @@ static int
ambiguous_names_p (struct bp_location *loc)
{
struct bp_location *l;
htab_t htab = htab_create_alloc (13, htab_hash_string, streq_hash, NULL,
xcalloc, xfree);
htab_up htab (htab_create_alloc (13, htab_hash_string, streq_hash, NULL,
xcalloc, xfree));
for (l = loc; l != NULL; l = l->next)
{
@ -13258,19 +13258,15 @@ ambiguous_names_p (struct bp_location *loc)
if (name == NULL)
continue;
slot = (const char **) htab_find_slot (htab, (const void *) name,
slot = (const char **) htab_find_slot (htab.get (), (const void *) name,
INSERT);
/* NOTE: We can assume slot != NULL here because xcalloc never
returns NULL. */
if (*slot != NULL)
{
htab_delete (htab);
return 1;
}
return 1;
*slot = name;
}
htab_delete (htab);
return 0;
}