[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH][merge-tracking] remove redundant for loop in svn_fs_merge_info__get_merge_info

From: Kamesh Jayachandran <kamesh_at_collab.net>
Date: 2006-10-10 12:08:29 CEST

Hi All,
Find the attached patch and log.

With regards
Kamesh Jayachandran

[[[
Patch by: Kamesh Jayachandran <kamesh@collab.net>
  Move the code from the redundant 'for' loop to relevant place.

* subversion/libsvn_fs_util/merge-info-sqlite-index.c
  (svn_fs_merge_info__get_merge_info):
   Stringify the mergeinfo hash in the same 'for' loop where we get them.

]]]

Index: subversion/libsvn_fs_util/merge-info-sqlite-index.c
===================================================================
--- subversion/libsvn_fs_util/merge-info-sqlite-index.c (revision 21862)
+++ subversion/libsvn_fs_util/merge-info-sqlite-index.c (working copy)
@@ -519,18 +519,12 @@
   for (i = 0; i < paths->nelts; i++)
     {
       const char *path = APR_ARRAY_IDX(paths, i, const char *);
+ apr_hash_t *currhash;
+ svn_stringbuf_t *mergestring;
 
       SVN_ERR (get_merge_info_for_path (db, path, rev, *mergeinfo,
                                         mergeinfo_cache, TRUE,
                                         include_parents, pool));
- }
-
- for (i = 0; i < paths->nelts; i++)
- {
- svn_stringbuf_t *mergestring;
- apr_hash_t *currhash;
- const char *path = APR_ARRAY_IDX(paths, i, const char *);
-
       currhash = apr_hash_get(*mergeinfo, path, APR_HASH_KEY_STRING);
       if (currhash)
         {
@@ -539,6 +533,7 @@
           apr_hash_set(*mergeinfo, path, APR_HASH_KEY_STRING, mergestring->data);
         }
     }
+
   SQLITE_ERR(sqlite3_close(db), db);
   return SVN_NO_ERROR;
 }

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Oct 10 12:11:54 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.