apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bo...@apache.org
Subject svn commit: r657643 - /apr/apr-util/trunk/dbd/apr_dbd_pgsql.c
Date Sun, 18 May 2008 21:32:55 GMT
Author: bojan
Date: Sun May 18 14:32:55 2008
New Revision: 657643

URL: http://svn.apache.org/viewvc?rev=657643&view=rev
Log:
Avoid unnecessary copying

Modified:
    apr/apr-util/trunk/dbd/apr_dbd_pgsql.c

Modified: apr/apr-util/trunk/dbd/apr_dbd_pgsql.c
URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/dbd/apr_dbd_pgsql.c?rev=657643&r1=657642&r2=657643&view=diff
==============================================================================
--- apr/apr-util/trunk/dbd/apr_dbd_pgsql.c (original)
+++ apr/apr-util/trunk/dbd/apr_dbd_pgsql.c Sun May 18 14:32:55 2008
@@ -231,14 +231,23 @@
         row = apr_palloc(pool, sizeof(apr_dbd_row_t));
         *rowp = row;
         row->res = res;
-        row->n = sequential ? 0 : (rownum > 0 ? --rownum : row->n);
+        if ( sequential ) {
+            row->n = 0;
+        }
+        else {
+            if (rownum > 0) {
+                row->n = --rownum;
+            }
+        }
     }
     else {
         if ( sequential ) {
             ++row->n;
         }
         else {
-            row->n = (rownum > 0 ? --rownum : row->n);
+            if (rownum > 0) {
+                row->n = --rownum;
+            }
         }
     }
 



Mime
View raw message