[libgda] Small optimization



commit b02771183e727e1e5552faacdf42714bf52d655f
Author: Vivien Malerba <malerba gnome-db org>
Date:   Tue Nov 22 08:30:35 2011 +0100

    Small optimization

 libgda/gda-connection.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/libgda/gda-connection.c b/libgda/gda-connection.c
index 1a3d001..8fb8c50 100644
--- a/libgda/gda-connection.c
+++ b/libgda/gda-connection.c
@@ -2873,9 +2873,13 @@ make_col_types_array (va_list args)
 	gint max = 10;
 	gint col, lastidx = 0;
 
+	col = va_arg (args, gint);
+	if (col < 0)
+		return NULL;
+
 	types = g_new0 (GType, max + 1);
 	types [max] = G_TYPE_NONE;
-	for (col = va_arg (args, gint); col >= 0; col = va_arg (args, gint)) {
+	for (; col >= 0; col = va_arg (args, gint)) {
 		if (col >= max) {
 			gint i;
 			types = g_renew (GType, types, col + 5 + 1);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]