From 4fd692271d72ac69890766d121b730d502ebcb19 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Tue, 22 Oct 2019 11:30:27 +0200 Subject: [PATCH] Don't shadow outer variable. --- src/surf/network_cm02.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/surf/network_cm02.cpp b/src/surf/network_cm02.cpp index 4c04ee86ac..697e36aad9 100644 --- a/src/surf/network_cm02.cpp +++ b/src/surf/network_cm02.cpp @@ -242,14 +242,14 @@ Action* NetworkCm02Model::communicate(s4u::Host* src, s4u::Host* dst, double siz if (link->get_sharing_policy() == s4u::Link::SharingPolicy::WIFI) { NetworkWifiLink* wifi_link = static_cast(link); - double rate = wifi_link->get_host_rate(src); - if (rate == -1) - rate = wifi_link->get_host_rate(dst); - xbt_assert(rate != -1, + double wifi_rate = wifi_link->get_host_rate(src); + if (wifi_rate == -1.0) + wifi_rate = wifi_link->get_host_rate(dst); + xbt_assert(wifi_rate != -1.0, "None of the source (%s) or destination (%s) is connected to the Access Point '%s'. " "Please use set_host_rate() on all stations.", src->get_cname(), dst->get_cname(), link->get_cname()); - get_maxmin_system()->expand(link->get_constraint(), action->get_variable(), 1.0 / rate); + get_maxmin_system()->expand(link->get_constraint(), action->get_variable(), 1.0 / wifi_rate); } else { get_maxmin_system()->expand(link->get_constraint(), action->get_variable(), 1.0); -- 2.20.1