about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@gmail.com>2011-05-14 01:03:08 -0400
committerUlrich Drepper <drepper@gmail.com>2011-05-14 01:03:08 -0400
commit0656e90edc091f122284b602d2d590314e40c97a (patch)
tree3f18f65d2bd00ead8a11ef951a6cc1aabbdea8c8
parent1af4e29837e9969377781b47254b6e4c293353ed (diff)
downloadglibc-0656e90edc091f122284b602d2d590314e40c97a.tar.gz
glibc-0656e90edc091f122284b602d2d590314e40c97a.tar.xz
glibc-0656e90edc091f122284b602d2d590314e40c97a.zip
Optimize conversion of single character in gconv
-rw-r--r--ChangeLog3
-rw-r--r--iconv/loop.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 6c125e3029..36a37087b1 100644
--- 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>
 
diff --git a/iconv/loop.c b/iconv/loop.c
index 72fef94222..4f430628f7 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