Просмотр исходного кода

net/session/outbound_session::fetch_address(): simplyfied returns

skoupidi 2 лет назад
Родитель
Сommit
c04667a845
1 измененных файлов с 2 добавлено и 6 удалено
  1. 2 6
      src/net/session/outbound_session.rs

+ 2 - 6
src/net/session/outbound_session.rs

@@ -213,8 +213,6 @@ impl Slot {
 
 
                 return hosts.check_address_with_lock(self.p2p(), addrs).await
                 return hosts.check_address_with_lock(self.p2p(), addrs).await
             }
             }
-
-            return None
         } else if slot_count < white_count {
         } else if slot_count < white_count {
             // Up to white_connection_percent connections:
             // Up to white_connection_percent connections:
             //  Select from the whitelist
             //  Select from the whitelist
@@ -231,8 +229,6 @@ impl Slot {
 
 
                 return hosts.check_address_with_lock(self.p2p(), addrs).await
                 return hosts.check_address_with_lock(self.p2p(), addrs).await
             }
             }
-
-            return None
         } else {
         } else {
             // All other connections:
             // All other connections:
             //  Select from the greylist
             //  Select from the greylist
@@ -242,9 +238,9 @@ impl Slot {
 
 
                 return hosts.check_address_with_lock(self.p2p(), addrs).await
                 return hosts.check_address_with_lock(self.p2p(), addrs).await
             }
             }
-
-            return None
         }
         }
+
+        None
     }
     }
 
 
     // We first try to make connections to the addresses on our anchor list. We then find some
     // We first try to make connections to the addresses on our anchor list. We then find some