Browse Source

v.generalize: simplify code

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@64483 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 10 năm trước cách đây
mục cha
commit
9f0a0e0981
1 tập tin đã thay đổi với 8 bổ sung19 xóa
  1. 8 19
      vector/v.generalize/main.c

+ 8 - 19
vector/v.generalize/main.c

@@ -430,30 +430,19 @@ int main(int argc, char *argv[])
 			
 			/* check if any of the centroids is selected */
 			Vect_get_line_areas(&Out, i, &left, &right);
+			if (left < 0)
+			    left = Vect_get_isle_area(&Out, abs(left));
+			if (right < 0)
+			    right = Vect_get_isle_area(&Out, abs(right));
+
 			if (left > 0) {
 			    Vect_get_area_cats(&Out, left, Cats);
 			    do_line = Vect_cats_in_constraint(Cats, layer, cat_list);
 			}
-			else if (left < 0) {
-			    left = Vect_get_isle_area(&Out, abs(left));
-			    if (left > 0) {
-				Vect_get_area_cats(&Out, left, Cats);
-				do_line = Vect_cats_in_constraint(Cats, layer, cat_list);
-			    }
-			}
 			
-			if (!do_line) {
-			    if (right > 0) {
-				Vect_get_area_cats(&Out, right, Cats);
-				do_line = Vect_cats_in_constraint(Cats, layer, cat_list);
-			    }
-			    else if (right < 0) {
-				right = Vect_get_isle_area(&Out, abs(right));
-				if (right > 0) {
-				    Vect_get_area_cats(&Out, right, Cats);
-				    do_line = Vect_cats_in_constraint(Cats, layer, cat_list);
-				}
-			    }
+			if (!do_line && right > 0) {
+			    Vect_get_area_cats(&Out, right, Cats);
+			    do_line = Vect_cats_in_constraint(Cats, layer, cat_list);
 			}
 		    }
 		    if (!do_line)