projects
/
pspp
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6e362c9
)
Small optimization.
author
Bruno Haible
<bruno@clisp.org>
Sun, 11 Feb 2007 22:30:04 +0000
(22:30 +0000)
committer
Bruno Haible
<bruno@clisp.org>
Sun, 11 Feb 2007 22:30:04 +0000
(22:30 +0000)
ChangeLog
patch
|
blob
|
history
lib/mbscspn.c
patch
|
blob
|
history
diff --git
a/ChangeLog
b/ChangeLog
index bfe4e299e6bbd4c77f902866c65e74810d222372..b379469aff6e2942e6b03f0178df27ef37c15833 100644
(file)
--- a/
ChangeLog
+++ b/
ChangeLog
@@
-1,5
+1,8
@@
2007-02-11 Bruno Haible <bruno@clisp.org>
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.
* modules/mbscspn-tests: New file.
* tests/test-mbscspn.sh: New file.
* tests/test-mbscspn.c: New file.
diff --git
a/lib/mbscspn.c
b/lib/mbscspn.c
index 30153a14ca59be05134fe13b3f981aaf71927687..543a121fa7454e352f7e906dffd44b70f8730366 100644
(file)
--- 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 (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
{
}
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)))
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
}
else
#endif