From 5d24ff73a2c57b94e8578d327d91e869dcae2c32 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 8 Feb 2015 19:43:46 +0000 Subject: [PATCH] -simplify flow --- src/ats/plugin_ats_proportional.c | 39 +++++++++++++++---------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/src/ats/plugin_ats_proportional.c b/src/ats/plugin_ats_proportional.c index ad026c619..f7d68e629 100644 --- a/src/ats/plugin_ats_proportional.c +++ b/src/ats/plugin_ats_proportional.c @@ -1127,26 +1127,25 @@ GAS_proportional_stop_get_preferred_address (void *solver, cur = get_active_address (s, peer); - if (NULL != cur) - { - LOG (GNUNET_ERROR_TYPE_INFO, - "Disabling %s address %p for peer `%s'\n", - (GNUNET_NO == cur->active) ? "inactive" : "active", - cur, - GNUNET_i2s (&cur->peer)); - - /* Disabling current address */ - asi = cur->solver_information; - cur_net = asi->network; - asi->activated = GNUNET_TIME_UNIT_ZERO_ABS; - cur->active = GNUNET_NO; /* No active any longer */ - cur->assigned_bw_in = 0; /* no bandwidth assigned */ - cur->assigned_bw_out = 0; /* no bandwidth assigned */ - - address_decrement_active (s, cur_net); - - distribute_bandwidth_in_network (s, cur_net); - } + if (NULL == cur) + return; + LOG (GNUNET_ERROR_TYPE_INFO, + "Disabling %s address %p for peer `%s'\n", + (GNUNET_NO == cur->active) ? "inactive" : "active", + cur, + GNUNET_i2s (&cur->peer)); + + /* Disabling current address */ + asi = cur->solver_information; + cur_net = asi->network; + asi->activated = GNUNET_TIME_UNIT_ZERO_ABS; + cur->active = GNUNET_NO; /* No active any longer */ + cur->assigned_bw_in = 0; /* no bandwidth assigned */ + cur->assigned_bw_out = 0; /* no bandwidth assigned */ + address_decrement_active (s, + cur_net); + distribute_bandwidth_in_network (s, + cur_net); } -- 2.25.1