You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2010/04/19 19:25:50 UTC
svn commit: r935679 - /subversion/trunk/subversion/libsvn_wc/lock.c
Author: hwright
Date: Mon Apr 19 17:25:50 2010
New Revision: 935679
URL: http://svn.apache.org/viewvc?rev=935679&view=rev
Log:
Try to be a bit more clear on what conditions result in what output values
in a function. This also removes the need for a branch or two.
* subversion/libsvn_wc/lock.c
(svn_wc__adm_available): Simply assign the boolean value to the result
of a boolean operation.
Modified:
subversion/trunk/subversion/libsvn_wc/lock.c
Modified: subversion/trunk/subversion/libsvn_wc/lock.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/lock.c?rev=935679&r1=935678&r2=935679&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/lock.c (original)
+++ subversion/trunk/subversion/libsvn_wc/lock.c Mon Apr 19 17:25:50 2010
@@ -561,9 +561,6 @@ svn_wc__adm_available(svn_boolean_t *ava
svn_wc__db_status_t status;
svn_depth_t depth;
- *available = TRUE;
- if (obstructed)
- *obstructed = FALSE;
if (kind)
*kind = svn_wc__db_kind_unknown;
@@ -573,21 +570,18 @@ svn_wc__adm_available(svn_boolean_t *ava
NULL, NULL, NULL,
db, local_abspath, scratch_pool, scratch_pool));
- if (status == svn_wc__db_status_obstructed ||
- status == svn_wc__db_status_obstructed_add ||
- status == svn_wc__db_status_obstructed_delete)
- {
- *available = FALSE;
- if (obstructed)
- *obstructed = TRUE;
- }
- else if (status == svn_wc__db_status_absent ||
- status == svn_wc__db_status_excluded ||
- status == svn_wc__db_status_not_present ||
- depth == svn_depth_exclude)
- {
- *available = FALSE;
- }
+ if (obstructed)
+ *obstructed = (status == svn_wc__db_status_obstructed ||
+ status == svn_wc__db_status_obstructed_add ||
+ status == svn_wc__db_status_obstructed_delete);
+
+ *available = !(status == svn_wc__db_status_obstructed ||
+ status == svn_wc__db_status_obstructed_add ||
+ status == svn_wc__db_status_obstructed_delete ||
+ status == svn_wc__db_status_absent ||
+ status == svn_wc__db_status_excluded ||
+ status == svn_wc__db_status_not_present ||
+ depth == svn_depth_exclude);
return SVN_NO_ERROR;
}