diff options
author | Jean-Philippe Andre <jp.andre@samsung.com> | 2017-02-15 15:25:15 +0900 |
---|---|---|
committer | Jean-Philippe Andre <jp.andre@samsung.com> | 2017-02-15 15:35:38 +0900 |
commit | 63eb9a28b3c24a20ff26f71886a5150b3d428ad2 (patch) | |
tree | 7e4aae8bff643a6128d21e7fbd9b94d59d75a99c | |
parent | a11836b5a1dd075989fd7135d59f7ab8d4ec040a (diff) | |
download | efl-63eb9a28b3c24a20ff26f71886a5150b3d428ad2.tar.gz |
eo_debug: Remove some abusive goto where not needed
goto was used for micro-optimization. There is absolutely no
need for those if we're using the slow path with eo_debug.
Simplify the code.
-rw-r--r-- | src/lib/eo/eo.c | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c index a032e917c0..48d1d9d144 100644 --- a/src/lib/eo/eo.c +++ b/src/lib/eo/eo.c @@ -1964,24 +1964,22 @@ efl_data_scope_get(const Eo *obj_id, const Efl_Class *klass_id) EO_OBJ_POINTER_RETURN_VAL(obj_id, obj, NULL); EO_CLASS_POINTER_GOTO(klass_id, klass, err_klass); -#ifdef EO_DEBUG +#ifndef EO_DEBUG + ret = _efl_data_scope_safe_get(obj, klass); +#else if (_eo_class_mro_has(obj->klass, klass)) + { + ret = _efl_data_scope_safe_get(obj, klass); + if (!ret && (klass->desc->data_size == 0)) + ERR("Tried getting data of class '%s', but it has none.", klass->desc->name); + } + else + { + ERR("Tried getting data of class '%s' from object of class '%s', but the former is not a direct inheritance of the latter.", + klass->desc->name, obj->klass->desc->name); + } #endif - ret = _efl_data_scope_safe_get(obj, klass); -#ifdef EO_DEBUG - // rare to make it a goto to clear out instruction cache of rare code - else goto err_mro; - // rare to make it a goto to clear out instruction cache of rare code - if (!ret && (klass->desc->data_size == 0)) goto err_ret; - EO_OBJ_DONE(obj_id); - return ret; -err_ret: - ERR("Tried getting data of class '%s', but it has none.", klass->desc->name); - goto err_klass; -err_mro: - ERR("Tried getting data of class '%s' from object of class '%s', but the former is not a direct inheritance of the latter.", klass->desc->name, obj->klass->desc->name); -#endif err_klass: EO_OBJ_DONE(obj_id); return ret; |