]> rtime.felk.cvut.cz Git - eurobot/public.git/commitdiff
robofsm: Remove unnecessary new/delete pair
authorMichal Sojka <sojkam1@fel.cvut.cz>
Wed, 26 May 2010 14:31:52 +0000 (16:31 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Wed, 26 May 2010 14:31:52 +0000 (16:31 +0200)
src/robofsm/common-states.cc

index afc2b0d3eb10edf918a2d5c2a672af6a397ea57c..e68298a143f3a344af0b7cb69734a6fe5199350a 100644 (file)
@@ -101,9 +101,7 @@ FSM_STATE(approach_the_slope)
 {
        switch(FSM_EVENT) {
                case EV_ENTRY: {
-                               struct slope_approach_style *p = (struct slope_approach_style *) FSM_EVENT_PTR;
-                               slope_approach_style_p = new slope_approach_style(*p); // use copy constructor
-                               delete(p); // delete given data
+                               slope_approach_style_p = (struct slope_approach_style *) FSM_EVENT_PTR;
                                if (slope_approach_style_p == NULL) {
                                        printf("it is not allowed to call the approach_the_slope state  with NULL data\n!");
 #warning remove the next line