Skip to content

Commit

Permalink
metadata: elide peers allocation into Vec
Browse files Browse the repository at this point in the history
Perhaps the compiler would optimise this anyway, but now it's explicitly
better.
  • Loading branch information
wprzytula authored and NikodemGapski committed Jan 16, 2025
1 parent 09acd5d commit 51207c8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scylla/src/cluster/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -881,9 +881,10 @@ async fn query_peers(conn: &Arc<Connection>, connect_port: u16) -> Result<Vec<Pe

let peers = translated_peers_futures
.buffer_unordered(256)
.try_filter_map(|x| std::future::ready(Ok(x)))
.try_collect::<Vec<_>>()
.await?;
Ok(peers.into_iter().flatten().collect())
Ok(peers)
}

async fn create_peer_from_row(
Expand Down

0 comments on commit 51207c8

Please sign in to comment.