From 3f2c1f64897526d91d8ec58bb604f78b991224dc Mon Sep 17 00:00:00 2001 From: Federico Di Gregorio Date: Mon, 5 Apr 2010 11:07:19 +0200 Subject: [PATCH] /me does not like empty for loops --- psycopg/pqpath.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/psycopg/pqpath.c b/psycopg/pqpath.c index 987ec18c..c332160a 100644 --- a/psycopg/pqpath.c +++ b/psycopg/pqpath.c @@ -294,11 +294,9 @@ pq_clear_async(connectionObject *conn) many parts, i.e. "select 1; select 2", there will be many) and also finalize asynchronous processing so the connection will be ready to accept another query */ - for (;;) { - pgres = PQgetResult(conn->pgconn); + + while ((pgres = PQgetResult(conn->pgconn)) != NULL) { Dprintf("pq_clear_async: clearing PGresult at %p", pgres); - if (pgres == NULL) - break; CLEARPGRES(pgres); } conn->async_cursor = NULL;