You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2011/04/03 18:58:06 UTC

svn commit: r1088334 - /subversion/trunk/subversion/libsvn_subr/subst.c

Author: rhuijben
Date: Sun Apr  3 16:58:06 2011
New Revision: 1088334

URL: http://svn.apache.org/viewvc?rev=1088334&view=rev
Log:
This minor change to translate_chunk() reduces the checkout time of
^/subversion/trunk/subversion in my profiler by about 1% for me. If this
has the same result on production code then this patch will probably safe
quite a few trees.

This part of the code was imported from stefan2's performance branch. More
profiling results (especially from stefan2) welcome.


* subversion/libsvn_subr/subst.c
  (translate_chunk): Lose temporary variable and use boolean operators
    instead of bitwise.

Modified:
    subversion/trunk/subversion/libsvn_subr/subst.c

Modified: subversion/trunk/subversion/libsvn_subr/subst.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/subst.c?rev=1088334&r1=1088333&r2=1088334&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/subst.c (original)
+++ subversion/trunk/subversion/libsvn_subr/subst.c Sun Apr  3 16:58:06 2011
@@ -1069,12 +1069,10 @@ translate_chunk(svn_stream_t *dst,
                  and to reduce loop condition overhead. */
               while ((p + len + 4) <= end)
                 {
-                  char sum = interesting[(unsigned char)p[len]]
-                           | interesting[(unsigned char)p[len+1]]
-                           | interesting[(unsigned char)p[len+2]]
-                           | interesting[(unsigned char)p[len+3]];
-
-                  if (sum != 0)
+                  if (interesting[(unsigned char)p[len]]
+                      || interesting[(unsigned char)p[len+1]]
+                      || interesting[(unsigned char)p[len+2]]
+                      || interesting[(unsigned char)p[len+3]])
                     break;
 
                   len += 4;