[GRASS-SVN] r69118 - grass/trunk/lib/btree2

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Aug 10 01:05:46 PDT 2016


Author: mmetz
Date: 2016-08-10 01:05:46 -0700 (Wed, 10 Aug 2016)
New Revision: 69118

Modified:
   grass/trunk/lib/btree2/kdtree.c
Log:
btree2lib: fix kdtree test

Modified: grass/trunk/lib/btree2/kdtree.c
===================================================================
--- grass/trunk/lib/btree2/kdtree.c	2016-08-10 08:03:11 UTC (rev 69117)
+++ grass/trunk/lib/btree2/kdtree.c	2016-08-10 08:05:46 UTC (rev 69118)
@@ -434,7 +434,7 @@
 			uid[i] = uid[i - 1];
 			i--;
 		    }
-		    if (d[i] == dist && uid[i] == n->uid)
+		    if (i < found && d[i] == dist && uid[i] == n->uid)
 			G_fatal_error("knn: inserting duplicate");
 		    d[i] = dist;
 		    uid[i] = n->uid;



More information about the grass-commit mailing list