diff options
author | Bruno Haible <bruno@clisp.org> | 2007-02-11 22:30:04 +0000 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2007-02-11 22:30:04 +0000 |
commit | bfee08023a94899768c682d94a6ff2d702fa4f02 (patch) | |
tree | 91a6c7d6d6a057298be0003d362c8ba031c0d7f4 /lib/mbscspn.c | |
parent | 6e362c93a149add1233d410f3cbc5ebd71ce6c46 (diff) | |
download | gnulib-bfee08023a94899768c682d94a6ff2d702fa4f02.tar.gz |
Small optimization.
Diffstat (limited to 'lib/mbscspn.c')
-rw-r--r-- | lib/mbscspn.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/mbscspn.c b/lib/mbscspn.c index 30153a14ca..543a121fa7 100644 --- a/lib/mbscspn.c +++ b/lib/mbscspn.c @@ -50,8 +50,8 @@ mbscspn (const char *string, const char *accept) { if (mb_len (mbui_cur (iter)) == 1) { - if (mbschr (accept, (unsigned char) * mbui_cur_ptr (iter))) - return mbui_cur_ptr (iter) - string; + if (mbschr (accept, * mbui_cur_ptr (iter))) + goto found; } else { @@ -61,10 +61,11 @@ mbscspn (const char *string, const char *accept) mbui_avail (aiter); mbui_advance (aiter)) if (mb_equal (mbui_cur (aiter), mbui_cur (iter))) - return mbui_cur_ptr (iter) - string; + goto found; } } - return strlen (string); + found: + return mbui_cur_ptr (iter) - string; } else #endif |