Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[sonar] Don't name unused exceptions.
[simgrid.git] / examples / s4u / app-bittorrent / s4u-tracker.cpp
index 4e41ae8..b7bd4cd 100644 (file)
@@ -17,7 +17,7 @@ Tracker::Tracker(std::vector<std::string> args)
   // Retrieving end time
   try {
     deadline = std::stod(args[1]);
-  } catch (std::invalid_argument& ia) {
+  } catch (const std::invalid_argument&) {
     throw std::invalid_argument(std::string("Invalid deadline:") + args[1].c_str());
   }
   xbt_assert(deadline > 0, "Wrong deadline supplied");
@@ -56,7 +56,7 @@ void Tracker::operator()()
         do {
           next_peer = known_peers.begin();
           std::advance(next_peer, RngStream_RandInt(stream, 0, nb_known_peers - 1));
-        } while (ta->getPeers()->find(*next_peer) != ta->getPeers()->end());
+        } while (ta->getPeers().find(*next_peer) != ta->getPeers().end());
         ta->addPeer(*next_peer);
         tried++;
       }