[GRASS-SVN] r52524 - grass/trunk/lib/vector/Vlib

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Aug 4 12:02:51 PDT 2012


Author: mmetz
Date: 2012-08-04 12:02:51 -0700 (Sat, 04 Aug 2012)
New Revision: 52524

Modified:
   grass/trunk/lib/vector/Vlib/break_lines.c
Log:
Vlib break lines: optimization

Modified: grass/trunk/lib/vector/Vlib/break_lines.c
===================================================================
--- grass/trunk/lib/vector/Vlib/break_lines.c	2012-08-04 19:00:54 UTC (rev 52523)
+++ grass/trunk/lib/vector/Vlib/break_lines.c	2012-08-04 19:02:51 UTC (rev 52524)
@@ -240,12 +240,11 @@
 		Vect_get_line_nodes(Map, bline, &bnode1, &bnode2);
 		BBox = List->box[j];
 
+		node = 0;
 		if (anode1 == bnode1 || anode1 == bnode2)
 		    node = anode1;
 		else if (anode2 == bnode1 || anode2 == bnode2)
 		    node = anode2;
-		else
-		    node = 0;
 
 		if (node) {
 		    Vect_get_node_coor(Map, node, &nodex, &nodey, NULL);
@@ -399,14 +398,11 @@
 				}
 			    }
 			}
-			Vect_destroy_line_struct(BXLines[k]);
 		    }
 		    nbreaks += nbxlines - 1;
 		}
-		else {
-		    for (k = 0; k < nbxlines; k++)
-			Vect_destroy_line_struct(BXLines[k]);
-		}
+		for (k = 0; k < nbxlines; k++)
+		    Vect_destroy_line_struct(BXLines[k]);
 	    }
 	    if (BXLines)
 		G_free(BXLines);



More information about the grass-commit mailing list