cube.cc:
authorMarkus Bröker <mbroeker@largo.dyndns.tv>
Thu, 16 Apr 2009 12:49:11 +0200
changeset 36 f52a9deddfc0
parent 35 024c2932a31f
child 37 0fbbe329c3a2
cube.cc: * Create an object, move this object. * don't try to re-create an object of a fixed size... committer: Markus Bröker <mbroeker@largo.homelinux.org>
pmc/cube.cc
--- a/pmc/cube.cc
+++ b/pmc/cube.cc
@@ -32,12 +32,8 @@
 
 void Cube::move (Vector location)
 {
-    Vector *p_tmp;
-
     for (int i = 0; i < 8; i++) {
-        p_tmp = new Vector (*P[i] + location);
-        delete P[i];
-        P[i] = p_tmp;
+        *P[i] = *P[i] + location;
     }
 }