style: use hash_xinsert

* gnulib: Update to get hash_xinsert.
Use it where appropriate.
This commit is contained in:
Akim Demaille
2020-05-17 12:00:02 +02:00
parent ac3b6c18a5
commit 4590071287
8 changed files with 22 additions and 34 deletions

View File

@@ -50,8 +50,7 @@ uniqstr_new (char const *str)
{
/* First insertion in the hash. */
res = xstrdup (str);
if (!hash_insert (uniqstrs_table, res))
xalloc_die ();
hash_xinsert (uniqstrs_table, res);
}
return res;
}
@@ -81,9 +80,7 @@ uniqstr_concat (int nargs, ...)
va_end (args);
*p = '\0';
uniqstr res = hash_insert (uniqstrs_table, str);
if (!res)
xalloc_die ();
uniqstr res = hash_xinsert (uniqstrs_table, str);
if (res != str)
free (str);
return res;