Browse Source

v.distance: clean up search steps

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@57657 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 11 years ago
parent
commit
14b222b71c
1 changed files with 8 additions and 0 deletions
  1. 8 0
      vector/v.distance/main.c

+ 8 - 0
vector/v.distance/main.c

@@ -392,6 +392,14 @@ int main(int argc, char *argv[])
 	}
 	/* last step always max */
 	max_step[n_max_steps - 1] = max;
+	j = 1;
+	for (i = 1; i < n_max_steps; i++) {
+	    if (max_step[j - 1] < max_step[i]) {
+		max_step[j] = max_step[i];
+		j++;
+	    }
+	}
+	n_max_steps = j;
     }
     else {
 	max_step = G_malloc(sizeof(double));