summaryrefslogtreecommitdiff
path: root/libguile/srfi-13.c
diff options
context:
space:
mode:
authorMark H Weaver <mhw@netris.org>2011-03-10 17:35:19 -0500
committerMark H Weaver <mhw@netris.org>2011-03-10 17:38:26 -0500
commit06fc34c23f2c6987ba1dc8cbf5a084ff24a83e53 (patch)
treecf8a7154d3d1e790181159bc51b3f70e5bef5eb8 /libguile/srfi-13.c
parent514642d3c7b5406952e5461918b718e13a06a2c1 (diff)
downloadguile-06fc34c23f2c6987ba1dc8cbf5a084ff24a83e53.tar.gz
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.
Diffstat (limited to 'libguile/srfi-13.c')
-rw-r--r--libguile/srfi-13.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libguile/srfi-13.c b/libguile/srfi-13.c
index ab933c2ad..06d7f3b55 100644
--- a/libguile/srfi-13.c
+++ b/libguile/srfi-13.c
@@ -1181,7 +1181,9 @@ SCM_DEFINE (scm_string_eq, "string=", 2, 4, 0,
len1 = scm_i_string_length (s1);
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))
len1 *= 4;