1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 03:40:34 +02:00

scm_i_utf8_string_hash: switch to u8_mbtouc

libguile/hash.c (scm_i_utf8_string_hash): Switch from u8_mbtouc_unsafe
to u8_mbtouc since the unsafe variant is now the same (see the info
pages).
This commit is contained in:
Rob Browning 2024-12-11 11:21:45 -06:00
parent 98c8a014b2
commit c45e1f57ec

View file

@ -195,26 +195,26 @@ scm_i_utf8_string_hash (const char *str, size_t len)
/* Handle most of the key. */ /* Handle most of the key. */
while (length > 3) while (length > 3)
{ {
ustr += u8_mbtouc_unsafe (&u32, ustr, end - ustr); ustr += u8_mbtouc (&u32, ustr, end - ustr);
a += u32; a += u32;
ustr += u8_mbtouc_unsafe (&u32, ustr, end - ustr); ustr += u8_mbtouc (&u32, ustr, end - ustr);
b += u32; b += u32;
ustr += u8_mbtouc_unsafe (&u32, ustr, end - ustr); ustr += u8_mbtouc (&u32, ustr, end - ustr);
c += u32; c += u32;
mix (a, b, c); mix (a, b, c);
length -= 3; length -= 3;
} }
/* Handle the last 3 elements's. */ /* Handle the last 3 elements's. */
ustr += u8_mbtouc_unsafe (&u32, ustr, end - ustr); ustr += u8_mbtouc (&u32, ustr, end - ustr);
a += u32; a += u32;
if (--length) if (--length)
{ {
ustr += u8_mbtouc_unsafe (&u32, ustr, end - ustr); ustr += u8_mbtouc (&u32, ustr, end - ustr);
b += u32; b += u32;
if (--length) if (--length)
{ {
ustr += u8_mbtouc_unsafe (&u32, ustr, end - ustr); ustr += u8_mbtouc (&u32, ustr, end - ustr);
c += u32; c += u32;
} }
} }