cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=78c723b2ed4fffb1318b0cf407374b7005694f34
commit 78c723b2ed4fffb1318b0cf407374b7005694f34 Author: Srivardhan Hebbar <sri.heb...@samsung.com> Date: Sat Oct 31 02:36:14 2015 +0100 evas: removing redundant if case in gl_cocoa backend. Summary: According to my understanding of this function, this check of im_old is redundant, as im_old will never be NULL. For im_old to be NULL, image should be NULL. But that is checked at line 637. im is assigned image and im is checked for NULL. At line 654 im_old is assigned image and it is not modified till line 673. So this check would always return true and enter if case and would never enter else case. So removing the redundant code. Signed-off-by: Srivardhan Hebbar <sri.heb...@samsung.com> Reviewers: cedric Reviewed By: cedric Differential Revision: https://phab.enlightenment.org/D3233 Signed-off-by: Cedric BAIL <ced...@osg.samsung.com> --- src/modules/evas/engines/gl_cocoa/evas_engine.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/modules/evas/engines/gl_cocoa/evas_engine.c b/src/modules/evas/engines/gl_cocoa/evas_engine.c index 312f5ff..00e670a 100644 --- a/src/modules/evas/engines/gl_cocoa/evas_engine.c +++ b/src/modules/evas/engines/gl_cocoa/evas_engine.c @@ -670,15 +670,12 @@ eng_image_size_set(void *data, void *image, int w, int h) ((int)im_old->im->cache_entry.w == w) && ((int)im_old->im->cache_entry.h == h)) return image; - if (im_old) - { - im = evas_gl_common_image_new(re->win->gl_context, w, h, - eng_image_alpha_get(data, image), - eng_image_colorspace_get(data, image)); - evas_gl_common_image_free(im_old); - } - else - im = evas_gl_common_image_new(re->win->gl_context, w, h, 1, EVAS_COLORSPACE_ARGB8888); + + im = evas_gl_common_image_new(re->win->gl_context, w, h, + eng_image_alpha_get(data, image), + eng_image_colorspace_get(data, image)); + evas_gl_common_image_free(im_old); + return im; } --