perf: create buffer once (#4226)

This commit is contained in:
Matthias Seitz
2023-08-16 18:26:16 +02:00
committed by GitHub
parent 491b453edb
commit 7a922a6ed0

View File

@ -1656,8 +1656,8 @@ pub(crate) async fn receive_loop(udp: Arc<UdpSocket>, tx: IngressSender, local_i
});
};
loop {
let mut buf = [0; MAX_PACKET_SIZE];
loop {
let res = udp.recv_from(&mut buf).await;
match res {
Err(err) => {