summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-02-13 00:01:39 +0000
committerChristian Grothoff <christian@grothoff.org>2015-02-13 00:01:39 +0000
commitc1fa22fd40d14035c8d323cb4ae8724970850e73 (patch)
tree1f831eee766602a7715b249770ab24ec0dce757a /src
parent69b02446b5e358d37a6863d8fc45d5f90bbdea67 (diff)
simplify logic, avoid using uninit variable
Diffstat (limited to 'src')
-rw-r--r--src/ats/gnunet-service-ats_normalization.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/ats/gnunet-service-ats_normalization.c b/src/ats/gnunet-service-ats_normalization.c
index 64aef5492..a018e2524 100644
--- a/src/ats/gnunet-service-ats_normalization.c
+++ b/src/ats/gnunet-service-ats_normalization.c
@@ -232,7 +232,6 @@ GAS_normalization_update_property (struct ATS_Address *address)
{
const struct GNUNET_ATS_Properties *prop = &address->properties;
struct PropertyRange range;
- int range_changed;
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Updating properties for peer `%s'\n",
@@ -257,25 +256,23 @@ GAS_normalization_update_property (struct ATS_Address *address)
{
/* limits changed, (re)normalize all addresses */
property_range = range;
- range_changed = GNUNET_YES;
- }
- if (GNUNET_YES == range_changed)
GNUNET_CONTAINER_multipeermap_iterate (GSA_addresses,
&normalize_address,
NULL);
- else
- normalize_address (NULL,
- &address->peer,
- address);
- /* after all peers have been updated, notify about changes */
- if (GNUNET_YES == range_changed)
GNUNET_CONTAINER_multipeermap_iterate (GSA_addresses,
&notify_change,
NULL);
+ }
else
+ {
+ /* renormalize just this one address */
+ normalize_address (NULL,
+ &address->peer,
+ address);
notify_change (NULL,
&address->peer,
address);
+ }
GAS_plugin_solver_unlock ();
}