summaryrefslogtreecommitdiff
path: root/src/lib/eo
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-02-15 15:25:15 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-02-15 15:35:38 +0900
commit63eb9a28b3c24a20ff26f71886a5150b3d428ad2 (patch)
tree7e4aae8bff643a6128d21e7fbd9b94d59d75a99c /src/lib/eo
parenta11836b5a1dd075989fd7135d59f7ab8d4ec040a (diff)
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.
Diffstat (limited to 'src/lib/eo')
-rw-r--r--src/lib/eo/eo.c28
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)
1964 EO_OBJ_POINTER_RETURN_VAL(obj_id, obj, NULL); 1964 EO_OBJ_POINTER_RETURN_VAL(obj_id, obj, NULL);
1965 EO_CLASS_POINTER_GOTO(klass_id, klass, err_klass); 1965 EO_CLASS_POINTER_GOTO(klass_id, klass, err_klass);
1966 1966
1967#ifdef EO_DEBUG 1967#ifndef EO_DEBUG
1968 ret = _efl_data_scope_safe_get(obj, klass);
1969#else
1968 if (_eo_class_mro_has(obj->klass, klass)) 1970 if (_eo_class_mro_has(obj->klass, klass))
1971 {
1972 ret = _efl_data_scope_safe_get(obj, klass);
1973 if (!ret && (klass->desc->data_size == 0))
1974 ERR("Tried getting data of class '%s', but it has none.", klass->desc->name);
1975 }
1976 else
1977 {
1978 ERR("Tried getting data of class '%s' from object of class '%s', but the former is not a direct inheritance of the latter.",
1979 klass->desc->name, obj->klass->desc->name);
1980 }
1969#endif 1981#endif
1970 ret = _efl_data_scope_safe_get(obj, klass);
1971#ifdef EO_DEBUG
1972 // rare to make it a goto to clear out instruction cache of rare code
1973 else goto err_mro;
1974 // rare to make it a goto to clear out instruction cache of rare code
1975 if (!ret && (klass->desc->data_size == 0)) goto err_ret;
1976 EO_OBJ_DONE(obj_id);
1977 return ret;
1978 1982
1979err_ret:
1980 ERR("Tried getting data of class '%s', but it has none.", klass->desc->name);
1981 goto err_klass;
1982err_mro:
1983 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);
1984#endif
1985err_klass: 1983err_klass:
1986 EO_OBJ_DONE(obj_id); 1984 EO_OBJ_DONE(obj_id);
1987 return ret; 1985 return ret;