mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 20:00:19 +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:
parent
98c8a014b2
commit
c45e1f57ec
1 changed files with 6 additions and 6 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue