Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use xbt_XXX_is_empty() instead of testing xbt_XXX_length() against 0.
[simgrid.git] / examples / msg / bittorrent / peer.c
index 2a9db33..4c930b7 100644 (file)
@@ -571,7 +571,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 = xbt_dict_cursor_get_key(cursor);
     connection_t peer_choked = xbt_dict_cursor_get_data(cursor);
     if (peer_choked) {