ecore_evas: Unnecessary to test p before calling free(p)
authorBryce Harrington <bryce@osg.samsung.com>
Tue, 18 Apr 2017 07:18:56 +0000 (16:18 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Tue, 18 Apr 2017 09:42:51 +0000 (18:42 +0900)
Summary:
Modern, standards-compliant compilers already test p, so as per the C
spec it is superfluous to do so before the call.

Reviewers: jpeg

Reviewed By: jpeg

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4791

src/lib/ecore_evas/ecore_evas.c

index bc847b0..d34fa8e 100644 (file)
@@ -3098,19 +3098,19 @@ _ecore_evas_free(Ecore_Evas *ee)
      }
    if (ee->data) eina_hash_free(ee->data);
    ee->data = NULL;
-   if (ee->name) free(ee->name);
+   free(ee->name);
    ee->name = NULL;
-   if (ee->prop.title) free(ee->prop.title);
+   free(ee->prop.title);
    ee->prop.title = NULL;
-   if (ee->prop.name) free(ee->prop.name);
+   free(ee->prop.name);
    ee->prop.name = NULL;
-   if (ee->prop.clas) free(ee->prop.clas);
+   free(ee->prop.clas);
    ee->prop.clas = NULL;
    _ecore_evas_window_profile_free(ee);
    ee->prop.profile.name = NULL;
    _ecore_evas_window_available_profiles_free(ee);
    ee->prop.profile.available_list = NULL;
-   if (ee->prop.wm_rot.available_rots) free(ee->prop.wm_rot.available_rots);
+   free(ee->prop.wm_rot.available_rots);
    ee->prop.wm_rot.available_rots = NULL;
    if (ee->prop.wm_rot.manual_mode.timer)
      ecore_timer_del(ee->prop.wm_rot.manual_mode.timer);
@@ -3119,7 +3119,7 @@ _ecore_evas_free(Ecore_Evas *ee)
    efl_event_callback_array_del(ee->evas, _ecore_evas_device_cbs(), ee);
    eina_hash_free(ee->prop.cursors);
    ee->prop.cursors = NULL;
-   if (ee->evas) evas_free(ee->evas);
+   evas_free(ee->evas);
    ee->evas = NULL;
    ECORE_MAGIC_SET(ee, ECORE_MAGIC_NONE);
    ee->driver = NULL;