diff mbox series

[3/3] go: use htab_eq_string in godump

Message ID 20210505213317.513520-4-tom@tromey.com
State New
Headers show
Series Add htab_eq_string to libiberty | expand

Commit Message

Tom Tromey May 5, 2021, 9:33 p.m. UTC
This changes godump to use the new htab_eq_string function.

gcc

	* godump.c (string_hash_eq): Remove.
	(go_finish): Use htab_eq_string.
---
 gcc/godump.c | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

Comments

Richard Biener May 6, 2021, 7:26 a.m. UTC | #1
On Thu, May 6, 2021 at 12:44 AM Tom Tromey <tom@tromey.com> wrote:
>
> This changes godump to use the new htab_eq_string function.

OK.

> gcc
>
>         * godump.c (string_hash_eq): Remove.
>         (go_finish): Use htab_eq_string.
> ---
>  gcc/godump.c | 14 +++-----------
>  1 file changed, 3 insertions(+), 11 deletions(-)
>
> diff --git a/gcc/godump.c b/gcc/godump.c
> index 7864d9d63e5d..cf9989490356 100644
> --- a/gcc/godump.c
> +++ b/gcc/godump.c
> @@ -109,14 +109,6 @@ macro_hash_del (void *v)
>    XDELETE (mhv);
>  }
>
> -/* For the string hash tables.  */
> -
> -static int
> -string_hash_eq (const void *y1, const void *y2)
> -{
> -  return strcmp ((const char *) y1, (const char *) y2) == 0;
> -}
> -
>  /* A macro definition.  */
>
>  static void
> @@ -1374,11 +1366,11 @@ go_finish (const char *filename)
>    real_debug_hooks->finish (filename);
>
>    container.type_hash = htab_create (100, htab_hash_string,
> -                                     string_hash_eq, NULL);
> +                                    htab_eq_string, NULL);
>    container.invalid_hash = htab_create (10, htab_hash_string,
> -                                       string_hash_eq, NULL);
> +                                       htab_eq_string, NULL);
>    container.keyword_hash = htab_create (50, htab_hash_string,
> -                                        string_hash_eq, NULL);
> +                                       htab_eq_string, NULL);
>    obstack_init (&container.type_obstack);
>
>    keyword_hash_init (&container);
> --
> 2.26.3
>
diff mbox series

Patch

diff --git a/gcc/godump.c b/gcc/godump.c
index 7864d9d63e5d..cf9989490356 100644
--- a/gcc/godump.c
+++ b/gcc/godump.c
@@ -109,14 +109,6 @@  macro_hash_del (void *v)
   XDELETE (mhv);
 }
 
-/* For the string hash tables.  */
-
-static int
-string_hash_eq (const void *y1, const void *y2)
-{
-  return strcmp ((const char *) y1, (const char *) y2) == 0;
-}
-
 /* A macro definition.  */
 
 static void
@@ -1374,11 +1366,11 @@  go_finish (const char *filename)
   real_debug_hooks->finish (filename);
 
   container.type_hash = htab_create (100, htab_hash_string,
-                                     string_hash_eq, NULL);
+				     htab_eq_string, NULL);
   container.invalid_hash = htab_create (10, htab_hash_string,
-					string_hash_eq, NULL);
+					htab_eq_string, NULL);
   container.keyword_hash = htab_create (50, htab_hash_string,
-                                        string_hash_eq, NULL);
+					htab_eq_string, NULL);
   obstack_init (&container.type_obstack);
 
   keyword_hash_init (&container);