Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Misc sonar threats.
[simgrid.git] / teshsuite / msg / app-bittorrent / bittorrent-peer.c
index 700d920..308a7b8 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2018. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2012-2019. 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. */
@@ -626,9 +626,8 @@ void update_choked_peers(peer_t peer)
           i++;
         }
         xbt_dict_cursor_free(&cursor);
-        if (peer_choosed == NULL)
-          THROWF(unknown_error, 0, "A peer should have be selected at this point");
-        else if ((peer_choosed->interested == 0) || (peer_choosed->choked_upload == 0))
+        xbt_assert(peer_choosed != NULL, "A peer should have been selected at this point");
+        if ((peer_choosed->interested == 0) || (peer_choosed->choked_upload == 0))
           peer_choosed = NULL;
         else
           XBT_DEBUG("Nothing to do, keep going");