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 <derek.foreman.samsung@gmail.com>
This commit is contained in:
Derek Foreman 2019-01-24 11:15:11 -06:00
parent 745fb1cf3c
commit 87c5ffda58
1 changed files with 3 additions and 1 deletions

View File

@ -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);