cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=bf445d2476168ea57433c01a9a3f6107c87dc782

commit bf445d2476168ea57433c01a9a3f6107c87dc782
Author: Cedric BAIL <[email protected]>
Date:   Thu Nov 22 16:44:12 2018 -0800

    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 <[email protected]>
    Reviewed-by: Vitor Sousa da Silva <[email protected]>
    Differential Revision: https://phab.enlightenment.org/D7333
---
 src/lib/ecore_con/efl_net_control_access_point-connman.c | 3 +--
 src/lib/ecore_con/efl_net_control_technology-connman.c   | 3 +--
 src/lib/ecore_con/efl_net_ip_address.c                   | 2 +-
 3 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/lib/ecore_con/efl_net_control_access_point-connman.c 
b/src/lib/ecore_con/efl_net_control_access_point-connman.c
index 4dc676846e..a54cce2a50 100644
--- a/src/lib/ecore_con/efl_net_control_access_point-connman.c
+++ b/src/lib/ecore_con/efl_net_control_access_point-connman.c
@@ -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);
diff --git a/src/lib/ecore_con/efl_net_control_technology-connman.c 
b/src/lib/ecore_con/efl_net_control_technology-connman.c
index 2389498d06..92660de83f 100644
--- a/src/lib/ecore_con/efl_net_control_technology-connman.c
+++ b/src/lib/ecore_con/efl_net_control_technology-connman.c
@@ -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);
diff --git a/src/lib/ecore_con/efl_net_ip_address.c 
b/src/lib/ecore_con/efl_net_ip_address.c
index e2fbb68f06..276f102f9c 100644
--- a/src/lib/ecore_con/efl_net_ip_address.c
+++ b/src/lib/ecore_con/efl_net_ip_address.c
@@ -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);

-- 


Reply via email to