Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
defusing
[simgrid.git] / src / surf / network_wifi.cpp
index 1eba216..11d48d1 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2019-2020. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2019-2021. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -30,7 +30,7 @@ NetworkWifiLink::NetworkWifiLink(NetworkCm02Model* model, const std::string& nam
 void NetworkWifiLink::set_host_rate(const s4u::Host* host, int rate_level)
 {
   auto insert_done = host_rates_.insert(std::make_pair(host->get_name(), rate_level));
-  if (insert_done.second == false)
+  if (not insert_done.second)
     insert_done.first->second = rate_level;
 
   // Each time we add a host, we refresh the decay model
@@ -63,7 +63,7 @@ s4u::Link::SharingPolicy NetworkWifiLink::get_sharing_policy() const
 
 int NetworkWifiLink::get_host_count() const
 {
-  return host_rates_.size();
+  return static_cast<int>(host_rates_.size());
 }
 
 void NetworkWifiLink::refresh_decay_bandwidths(){
@@ -71,7 +71,7 @@ void NetworkWifiLink::refresh_decay_bandwidths(){
   int nSTA = get_host_count();
 
   std::vector<Metric> new_bandwidths;
-  for (auto bandwidth : bandwidths_){
+  for (auto const& bandwidth : bandwidths_) {
     // Instantiate decay model relatively to the actual bandwidth
     double max_bw=bandwidth.peak;
     double min_bw=bandwidth.peak-(wifi_max_rate_-wifi_min_rate_);