src/ldtypes.cpp

changeset 503
bebe09014dd6
parent 500
cad8cdc42a64
child 504
6a1fa662bfc1
--- a/src/ldtypes.cpp	Wed Oct 16 16:05:51 2013 +0300
+++ b/src/ldtypes.cpp	Wed Oct 16 16:40:42 2013 +0300
@@ -253,18 +253,13 @@
 // -----------------------------------------------------------------------------
 LDObject::~LDObject()
 {	// Remove this object from the selection array if it is there.
-	for (int i = 0; i < g_win->sel().size(); ++i)
-		if (g_win->sel() [i] == this)
-			g_win->sel().erase (i);
+	g_win->sel().removeOne (this);
 
 	// Delete the GL lists
 	GL::deleteLists (this);
 
 	// Remove this object from the list of LDObjects
-	int pos;
-
-	if ((pos = g_LDObjects.find (this)) != -1)
-		g_LDObjects.erase (pos);
+	g_LDObjects.removeOne (this);
 }
 
 // =============================================================================
@@ -366,11 +361,11 @@
 		obj->swap (file->obj (target));
 	}
 
-	objsToCompile.makeUnique();
+	removeDuplicates (objsToCompile);
 
 	// The objects need to be recompiled, otherwise their pick lists are left with
 	// the wrong index colors which messes up selection.
-for (LDObject * obj : objsToCompile)
+	for (LDObject* obj : objsToCompile)
 		g_win->R()->compileObject (obj);
 }
 

mercurial