Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use empty() to check for container emptiness.
[simgrid.git] / examples / deprecated / java / app / bittorrent / Peer.java
index b937889..3bd30bf 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2020. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2006-2021. 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. */
@@ -395,7 +395,7 @@ public class Peer extends Process {
   // Update the list of current choked and unchoked peers, using the choke algorithm
   private void updateChokedPeers() {
     round = (round + 1) % 3;
-    if (peers.size() == 0) {
+    if (peers.isEmpty()) {
       return;
     }
     //remove a peer from the list