]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Optimize conversion of single character in gconv
authorUlrich Drepper <drepper@gmail.com>
Sat, 14 May 2011 05:03:08 +0000 (01:03 -0400)
committerUlrich Drepper <drepper@gmail.com>
Sat, 14 May 2011 05:03:08 +0000 (01:03 -0400)
ChangeLog
iconv/loop.c

index 6c125e30296d197ab68ffb1023e1e6d9a2151f17..36a37087b17d5e29a6f1d486df08e3dc9e7bcf0f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,8 @@
 2011-05-14  Ulrich Drepper  <drepper@gmail.com>
 
        * iconv/loop.c (SINGLE) [STORE_REST]: Add input bytes to bytebuf before
-       storing incomplete byte sequence in state object.
+       storing incomplete byte sequence in state object.  Avoid testing for
+       guaranteed too small input if we know there is enough data available.
 
 2011-05-11  Andreas Schwab  <schwab@redhat.com>
 
index 72fef942228a9b3c53649684699637af6f13a581..4f430628f77079acad78846767a48c7ee03a8998 100644 (file)
@@ -395,7 +395,8 @@ SINGLE(LOOPFCT) (struct __gconv_step *step,
 #endif
 
   /* Are there enough bytes in the input buffer?  */
-  if (__builtin_expect (inptr + (MIN_NEEDED_INPUT - inlen) > inend, 0))
+  if (MIN_NEEDED_INPUT > 1
+      && __builtin_expect (inptr + (MIN_NEEDED_INPUT - inlen) > inend, 0))
     {
       *inptrp = inend;
 #ifdef STORE_REST