mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-07-01 10:41:33 +00:00
core/src/connections: Avoid call to contains twice (#2279)
This commit is contained in:
@ -264,8 +264,7 @@ where
|
|||||||
Poll::Ready(Some(Ok(ListenerEvent::NewAddress(a)))) => {
|
Poll::Ready(Some(Ok(ListenerEvent::NewAddress(a)))) => {
|
||||||
if listener_project.addresses.contains(&a) {
|
if listener_project.addresses.contains(&a) {
|
||||||
debug!("Transport has reported address {} multiple times", a)
|
debug!("Transport has reported address {} multiple times", a)
|
||||||
}
|
} else {
|
||||||
if !listener_project.addresses.contains(&a) {
|
|
||||||
listener_project.addresses.push(a.clone());
|
listener_project.addresses.push(a.clone());
|
||||||
}
|
}
|
||||||
let id = *listener_project.id;
|
let id = *listener_project.id;
|
||||||
|
Reference in New Issue
Block a user