You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2018/07/20 16:25:41 UTC

svn commit: r1836372 - /subversion/trunk/subversion/libsvn_client/repos_diff.c

Author: julianfoad
Date: Fri Jul 20 16:25:41 2018
New Revision: 1836372

URL: http://svn.apache.org/viewvc?rev=1836372&view=rev
Log:
Code simplification.

* subversion/libsvn_client/repos_diff.c
  (remove_non_prop_changes): Use an existing function to delete elements.

Modified:
    subversion/trunk/subversion/libsvn_client/repos_diff.c

Modified: subversion/trunk/subversion/libsvn_client/repos_diff.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/repos_diff.c?rev=1836372&r1=1836371&r2=1836372&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/repos_diff.c (original)
+++ subversion/trunk/subversion/libsvn_client/repos_diff.c Fri Jul 20 16:25:41 2018
@@ -51,6 +51,7 @@
 #include "private/svn_subr_private.h"
 #include "private/svn_wc_private.h"
 #include "private/svn_editor.h"
+#include "private/svn_sorts_private.h"
 
 /* Overall crawler editor baton.  */
 struct edit_baton {
@@ -404,15 +405,8 @@ remove_non_prop_changes(apr_hash_t *pris
 
           if (old_val && svn_string_compare(old_val, change->value))
             {
-              int j;
-
-              /* Remove the matching change by shifting the rest */
-              for (j = i; j < changes->nelts - 1; j++)
-                {
-                  APR_ARRAY_IDX(changes, j, svn_prop_t)
-                       = APR_ARRAY_IDX(changes, j+1, svn_prop_t);
-                }
-              changes->nelts--;
+              /* Remove the matching change and re-check the current index */
+              svn_sort__array_delete(changes, i, 1);
               i--;
             }
         }