X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/5997f75835d50b618ea8f7030ff2f554b32350d9..84402e8e2ee2a2d0bef25fdceb0a263ed8b471f6:/teshsuite/msg/app-bittorrent/tracker.c?ds=sidebyside diff --git a/teshsuite/msg/app-bittorrent/tracker.c b/teshsuite/msg/app-bittorrent/tracker.c index ba830b700c..ae0463339c 100644 --- a/teshsuite/msg/app-bittorrent/tracker.c +++ b/teshsuite/msg/app-bittorrent/tracker.c @@ -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 @@ -41,7 +41,7 @@ int tracker(int argc, char* argv[]) // Retrieve the data sent by the peer. tracker_task_data_t data = MSG_task_get_data(task_received); // Add the peer to our peer list. - if (is_in_list(peers_list, data->peer_id) == 0) { + if (!is_in_list(peers_list, data->peer_id)) { xbt_dynar_push_as(peers_list, int, data->peer_id); } // Sending peers to the peer @@ -126,7 +126,7 @@ void tracker_task_data_free(tracker_task_data_t task) * @param peers dynar containing the peers * @param id identifier of the peer to test */ -int is_in_list(xbt_dynar_t peers, int id) +int is_in_list(const_xbt_dynar_t peers, int id) { return xbt_dynar_member(peers, &id); }