From 3f57c8604112f57f7223d9db79181c6cbb88e37c Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Thu, 24 Jan 2019 11:15:11 -0600 Subject: [PATCH] evas: Defer object lookup until it's necessary We frequently BAIL from this function before we actually need the efl_data_scope_get() return, so we can save some pointer indirection by deferring. Differential Revision: https://phab.enlightenment.org/D7761 Signed-off-by: Derek Foreman --- src/lib/evas/canvas/efl_canvas_image.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/evas/canvas/efl_canvas_image.c b/src/lib/evas/canvas/efl_canvas_image.c index 42cbe4f..d00ee65 100644 --- a/src/lib/evas/canvas/efl_canvas_image.c +++ b/src/lib/evas/canvas/efl_canvas_image.c @@ -7,7 +7,7 @@ Eina_Bool _evas_image_mmap_set(Eo *eo_obj, const Eina_File *f, const char *key) { - Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); + Evas_Object_Protected_Data *obj; Evas_Image_Data *o = efl_data_scope_get(eo_obj, EFL_CANVAS_IMAGE_INTERNAL_CLASS); Evas_Image_Load_Opts lo; @@ -18,6 +18,8 @@ _evas_image_mmap_set(Eo *eo_obj, const Eina_File *f, const char *key) if ((o->cur->key) && (key) && (!strcmp(o->cur->key, key))) return EINA_FALSE; } + + obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); evas_object_async_block(obj); _evas_image_init_set(f, key, eo_obj, obj, o, &lo); o->engine_data = ENFN->image_mmap(ENC, o->cur->f, o->cur->key, &o->load_error, &lo); -- 2.7.4