Mercurial > hg > octave-nkf > gnulib-hg
changeset 8138:d18923c964ae
Small optimization.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Sun, 11 Feb 2007 22:30:04 +0000 |
parents | 32304cd3cf05 |
children | e8c69f00de52 |
files | ChangeLog lib/mbscspn.c |
diffstat | 2 files changed, 8 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2007-02-11 Bruno Haible <bruno@clisp.org> + * lib/mbscspn.c (mbscspn): Remove unnecessary strlen call and + unneeded cast. + * modules/mbscspn-tests: New file. * tests/test-mbscspn.sh: New file. * tests/test-mbscspn.c: New file.
--- a/lib/mbscspn.c +++ b/lib/mbscspn.c @@ -50,8 +50,8 @@ { 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 @@ 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