[postgis-tickets] r14689 - Fix initialization nit for @ustrk

Paul Ramsey pramsey at cleverelephant.ca
Wed Feb 24 09:18:09 PST 2016


Author: pramsey
Date: 2016-02-24 09:18:09 -0800 (Wed, 24 Feb 2016)
New Revision: 14689

Modified:
   trunk/liblwgeom/lwkmeans.c
Log:
Fix initialization nit for @ustrk


Modified: trunk/liblwgeom/lwkmeans.c
===================================================================
--- trunk/liblwgeom/lwkmeans.c	2016-02-24 17:13:36 UTC (rev 14688)
+++ trunk/liblwgeom/lwkmeans.c	2016-02-24 17:18:09 UTC (rev 14689)
@@ -85,6 +85,7 @@
 	kmeans_result result;
 	int *seen;
 	int sidx = 0;
+	int initialized = 0;
 
 	assert(k>0);
 	assert(ngeoms>0);
@@ -149,8 +150,9 @@
 		config.objs[i] = (Pointer)cp;
 
 		/* Since we're already here, let's calculate the extrema of the set */
-		if (i == 0)
+		if (!initialized)
 		{
+			initialized = 1;
 			min = *cp;
 			max = *cp;
 		}



More information about the postgis-tickets mailing list