From dc837049e60f98065d246b831165d78b8503e99e Mon Sep 17 00:00:00 2001 From: bojan Date: Sun, 18 May 2008 21:32:55 +0000 Subject: Avoid unnecessary copying git-svn-id: http://svn.apache.org/repos/asf/apr/apr-util/trunk@657643 13f79535-47bb-0310-9956-ffa450edef68 --- dbd/apr_dbd_pgsql.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'dbd/apr_dbd_pgsql.c') diff --git a/dbd/apr_dbd_pgsql.c b/dbd/apr_dbd_pgsql.c index 5b0ec5be..90a8b2d3 100644 --- a/dbd/apr_dbd_pgsql.c +++ b/dbd/apr_dbd_pgsql.c @@ -231,14 +231,23 @@ static int dbd_pgsql_get_row(apr_pool_t *pool, apr_dbd_results_t *res, 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; + } } } -- cgit v1.2.1