Permalink
Browse files

Optimize conversion of single character in gconv

  • Loading branch information...
1 parent 1af4e29 commit 0656e90edc091f122284b602d2d590314e40c97a @drepper drepper committed May 14, 2011
Showing with 4 additions and 2 deletions.
  1. +2 −1 ChangeLog
  2. +2 −1 iconv/loop.c
View
@@ -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>
View
@@ -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

0 comments on commit 0656e90

Please sign in to comment.