]> AND Public Git Repository - simgrid.git/blobdiff - examples/s4u/app-bittorrent/s4u-tracker.cpp
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fix ns3
[simgrid.git] / examples / s4u / app-bittorrent / s4u-tracker.cpp
index 390020a0b799f81cdc09babaa050007855b5efff..f9f70b8014df3751c8c9c17e7d8b770177fbcf6e 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2019. The SimGrid Team.
+/* Copyright (c) 2012-2020. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -52,8 +52,7 @@ void Tracker::operator()()
       while (tried < max_tries) {
         do {
           next_peer = known_peers.begin();
-          std::uniform_int_distribution<int> dist(0, nb_known_peers - 1);
-          std::advance(next_peer, dist(generator));
+          std::advance(next_peer, random.uniform_int(0, nb_known_peers - 1));
         } while (ta->getPeers().find(*next_peer) != ta->getPeers().end());
         ta->addPeer(*next_peer);
         tried++;