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

[PATCH] Combine redundant 'if' block.

From: Noorul Islam K M <noorul_at_collab.net>
Date: Sat, 04 Dec 2010 14:38:30 +0530

Attached is the patch which combines redundant 'if' block.

Log
[[[

* subversion/libsvn_client/copy.c
  (try_copy): Combine redundant 'if' block.

Patch by: Noorul Islam K M <noorul{_AT_}collab.net>
]]]

Thanks and Regards
Noorul

Index: subversion/libsvn_client/copy.c
===================================================================
--- subversion/libsvn_client/copy.c (revision 1041944)
+++ subversion/libsvn_client/copy.c (working copy)
@@ -1944,10 +1944,19 @@
           svn_pool_clear(iterpool);
 
           if (src_is_url)
- pair->src_abspath_or_url = apr_pstrdup(pool, source->path);
+ {
+ pair->src_abspath_or_url = apr_pstrdup(pool, source->path);
+ src_basename = svn_uri_basename(pair->src_abspath_or_url,
+ iterpool);
+ }
           else
- SVN_ERR(svn_dirent_get_absolute(&pair->src_abspath_or_url,
- source->path, pool));
+ {
+ SVN_ERR(svn_dirent_get_absolute(&pair->src_abspath_or_url,
+ source->path, pool));
+ src_basename = svn_dirent_basename(pair->src_abspath_or_url,
+ iterpool);
+ }
+
           pair->src_op_revision = *source->revision;
           pair->src_peg_revision = *source->peg_revision;
 
@@ -1956,12 +1965,7 @@
                                             src_is_url,
                                             TRUE,
                                             iterpool));
- if (src_is_url)
- src_basename = svn_uri_basename(pair->src_abspath_or_url,
- iterpool);
- else
- src_basename = svn_dirent_basename(pair->src_abspath_or_url,
- iterpool);
+
           if (srcs_are_urls && ! dst_is_url)
             src_basename = svn_path_uri_decode(src_basename, iterpool);
 
Received on 2010-12-04 10:09:25 CET

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.