You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2014/04/27 14:19:41 UTC

svn commit: r1590383 - /subversion/trunk/subversion/libsvn_fs_fs/transaction.c

Author: stefan2
Date: Sun Apr 27 12:19:40 2014
New Revision: 1590383

URL: http://svn.apache.org/r1590383
Log:
Fix a negative shift distance caused by an off-by-one error.
It did not affect data correctness but reconstruction efficiency.

* subversion/libsvn_fs_fs/transaction.c
  (shards_spanned): A non-zero walk touches at least the starting shard.
  (choose_delta_base): Fix comment grammar and spelling.

Found by: philip

Modified:
    subversion/trunk/subversion/libsvn_fs_fs/transaction.c

Modified: subversion/trunk/subversion/libsvn_fs_fs/transaction.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/transaction.c?rev=1590383&r1=1590382&r2=1590383&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/transaction.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/transaction.c Sun Apr 27 12:19:40 2014
@@ -1899,7 +1899,7 @@ shards_spanned(int *spanned,
   fs_fs_data_t *ffd = fs->fsap_data;
   int shard_size = ffd->max_files_per_dir ? ffd->max_files_per_dir : 1;
 
-  int count = 0;
+  int count = walk ? 1 : 0; /* The start of a walk already touches a shard. */
   svn_revnum_t shard, last_shard = ffd->youngest_rev_cache / shard_size;
   while (walk-- && noderev->predecessor_count)
     {
@@ -1974,7 +1974,7 @@ choose_delta_base(representation_t **rep
       SVN_ERR(shards_spanned(&shards, fs, noderev, walk, pool));
 
       /* We also don't want the linear deltification to span more shards
-         than deltas would be used in the simple skip-delta schme. */
+         than if deltas we used in a simple skip-delta scheme. */
       if ((1 << (--shards)) <= walk)
         count = noderev->predecessor_count - 1;
     }