mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 11:50:28 +02:00
Fix bug to make `string=' much faster
* libguile/srfi-13.c (scm_string_eq): Fix a bug which caused the slow general string_compare function to be used for strings of unequal lengths.
This commit is contained in:
parent
514642d3c7
commit
06fc34c23f
1 changed files with 3 additions and 1 deletions
|
@ -1181,7 +1181,9 @@ SCM_DEFINE (scm_string_eq, "string=", 2, 4, 0,
|
||||||
len1 = scm_i_string_length (s1);
|
len1 = scm_i_string_length (s1);
|
||||||
len2 = scm_i_string_length (s2);
|
len2 = scm_i_string_length (s2);
|
||||||
|
|
||||||
if (SCM_LIKELY (len1 == len2))
|
if (len1 != len2)
|
||||||
|
return SCM_BOOL_F;
|
||||||
|
else
|
||||||
{
|
{
|
||||||
if (!scm_i_is_narrow_string (s1))
|
if (!scm_i_is_narrow_string (s1))
|
||||||
len1 *= 4;
|
len1 *= 4;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue