ecore_con: simplify code by using proper helper.

efl_loop_promise_new is a helper function that does automatically figure out an
available scheduler and create a promise from it. Basically replacing the call to
eina_promise_new(efl_loop_future_scheduler_get(o), ...).

Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Reviewed-by: Vitor Sousa da Silva <vitorsousa@expertisesolutions.com.br>
Differential Revision: https://phab.enlightenment.org/D7333
This commit is contained in:
Cedric BAIL 2018-11-22 16:44:12 -08:00
parent 98b716d0fa
commit bf445d2476
3 changed files with 3 additions and 5 deletions

View File

@ -773,8 +773,7 @@ _efl_net_control_access_point_connect(Eo *o, Efl_Net_Control_Access_Point_Data *
Eina_Promise *promise;
Eina_Future *f = NULL;
promise = eina_promise_new(efl_loop_future_scheduler_get(o),
_efl_net_control_access_point_connect_promise_del, o);
promise = efl_loop_promise_new(o, _efl_net_control_access_point_connect_promise_del, o);
EINA_SAFETY_ON_NULL_RETURN_VAL(promise, NULL);
f = eina_future_new(promise);

View File

@ -399,8 +399,7 @@ _efl_net_control_technology_scan(Eo *o, Efl_Net_Control_Technology_Data *pd)
Eina_Promise *promise;
Eina_Future *f = NULL;
promise = eina_promise_new(efl_loop_future_scheduler_get(o),
_efl_net_control_technology_scan_promise_del, NULL);
promise = efl_loop_promise_new(o, _efl_net_control_technology_scan_promise_del, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(promise, NULL);
f = eina_future_new(promise);

View File

@ -572,7 +572,7 @@ _efl_net_ip_address_resolve(Eo *cls EINA_UNUSED, void *pd EINA_UNUSED, const cha
ctx->thread = efl_net_ip_resolve_async_new(host, port, &hints, _efl_net_ip_address_resolve_done, ctx);
EINA_SAFETY_ON_NULL_GOTO(ctx->thread, error_thread);
ctx->promise = eina_promise_new(efl_loop_future_scheduler_get(efl_main_loop_get()), _efl_net_ip_address_resolve_del, ctx);
ctx->promise = efl_loop_promise_new(efl_main_loop_get(), _efl_net_ip_address_resolve_del, ctx);
EINA_SAFETY_ON_NULL_GOTO(ctx->promise, error_promise);
free(str);