X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/5e044aacdc2c13e6d78c4f5bb64db0f25140bc10..9d87ca5268acfd15dfaf5068cc40f9d00a03e8c3:/teshsuite/msg/app-bittorrent/bittorrent-peer.c diff --git a/teshsuite/msg/app-bittorrent/bittorrent-peer.c b/teshsuite/msg/app-bittorrent/bittorrent-peer.c index 3a6e22fcb4..700d920c3a 100644 --- a/teshsuite/msg/app-bittorrent/bittorrent-peer.c +++ b/teshsuite/msg/app-bittorrent/bittorrent-peer.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2017. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2012-2018. 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. */ @@ -7,10 +7,12 @@ #include "bittorrent-messages.h" #include "connection.h" #include "tracker.h" -#include #include #include +#include +#include /* snprintf */ + XBT_LOG_NEW_DEFAULT_CATEGORY(msg_peers, "Messages specific for the peers"); /* @@ -589,7 +591,7 @@ void update_choked_peers(peer_t peer) // remove a peer from the list xbt_dict_cursor_t cursor = NULL; xbt_dict_cursor_first(peer->active_peers, &cursor); - if (xbt_dict_length(peer->active_peers) > 0) { + if (!xbt_dict_is_empty(peer->active_peers)) { key_choked = xbt_dict_cursor_get_key(cursor); peer_choked = xbt_dict_cursor_get_data(cursor); }