subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1328852 - /subversion/trunk/subversion/libsvn_wc/wc_db.c
Date Sun, 22 Apr 2012 11:48:32 GMT
Author: rhuijben
Date: Sun Apr 22 11:48:32 2012
New Revision: 1328852

URL: http://svn.apache.org/viewvc?rev=1328852&view=rev
Log:
* subversion/libsvn_wc/wc_db.c
  (get_min_max_revisions): Simplify error handling given the information that
    'select max(X), min(Y) from Q' always returns one row.
  (has_local_mods): Remove extra paren to fix compilation.

Modified:
    subversion/trunk/subversion/libsvn_wc/wc_db.c

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1328852&r1=1328851&r2=1328852&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Sun Apr 22 11:48:32 2012
@@ -12576,35 +12576,25 @@ get_min_max_revisions(svn_revnum_t *min_
                       apr_pool_t *scratch_pool)
 {
   svn_sqlite__stmt_t *stmt;
-  svn_boolean_t have_row;
   svn_revnum_t min_rev, max_rev;
 
   SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                     STMT_SELECT_MIN_MAX_REVISIONS));
   SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
-  SVN_ERR(svn_sqlite__step(&have_row, stmt));
-  if (have_row)
+  SVN_ERR(svn_sqlite__step_row(stmt));
+
+  if (committed)
     {
-      if (committed)
-        {
-          min_rev = svn_sqlite__column_revnum(stmt, 2);
-          max_rev = svn_sqlite__column_revnum(stmt, 3);
-        }
-      else
-        {
-          min_rev = svn_sqlite__column_revnum(stmt, 0);
-          max_rev = svn_sqlite__column_revnum(stmt, 1);
-        }
+      min_rev = svn_sqlite__column_revnum(stmt, 2);
+      max_rev = svn_sqlite__column_revnum(stmt, 3);
     }
   else
     {
-      min_rev = SVN_INVALID_REVNUM;
-      max_rev = SVN_INVALID_REVNUM;
+      min_rev = svn_sqlite__column_revnum(stmt, 0);
+      max_rev = svn_sqlite__column_revnum(stmt, 1);
     }
 
-  /* The statement should only return at most one row. */
-  SVN_ERR(svn_sqlite__step(&have_row, stmt));
-  SVN_ERR_ASSERT(! have_row);
+  /* The statement returns exactly one row. */
   SVN_ERR(svn_sqlite__reset(stmt));
 
   if (min_revision)
@@ -12926,7 +12916,7 @@ has_local_mods(svn_boolean_t *is_modifie
             {
               err = svn_wc__internal_file_modified_p(is_modified,
                                                      db, node_abspath,
-                                                     FALSE, iterpool));
+                                                     FALSE, iterpool);
 
               if (err)
                 return svn_error_trace(svn_error_compose_create(



Mime
View raw message