Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Optimize conversion of single character in gconv

  • Loading branch information...
commit 0656e90edc091f122284b602d2d590314e40c97a 1 parent 1af4e29
drepper authored May 14, 2011

Showing 2 changed files with 4 additions and 2 deletions. Show diff stats Hide diff stats

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

0 notes on commit 0656e90

Please sign in to comment.
Something went wrong with that request. Please try again.