From: Ulrich Drepper Date: Sat, 14 May 2011 05:03:08 +0000 (-0400) Subject: Optimize conversion of single character in gconv X-Git-Tag: glibc-2.14~93 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0656e90edc091f122284b602d2d590314e40c97a;p=thirdparty%2Fglibc.git Optimize conversion of single character in gconv --- diff --git a/ChangeLog b/ChangeLog index 6c125e30296..36a37087b17 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,8 @@ 2011-05-14 Ulrich Drepper * 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 diff --git a/iconv/loop.c b/iconv/loop.c index 72fef942228..4f430628f77 100644 --- a/iconv/loop.c +++ b/iconv/loop.c @@ -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