From 085e615ba7239c95056ca2c3af4cb4f8c42bb587 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Florkiewicz?= Date: Thu, 21 Sep 2023 16:12:05 +0200 Subject: [PATCH] less polling --- node/src/exchange/server.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/node/src/exchange/server.rs b/node/src/exchange/server.rs index f6472a036..8d034f3fe 100644 --- a/node/src/exchange/server.rs +++ b/node/src/exchange/server.rs @@ -104,10 +104,8 @@ where } pub fn poll(&mut self, cx: &mut Context<'_>) -> Poll<(C, ResponseType)> { - while let Poll::Ready(ev) = Pin::new(&mut self.store_jobs).poll_next(cx) { - if let Some(response) = ev { - return Poll::Ready(response); - } + while let Poll::Ready(Some(response)) = Pin::new(&mut self.store_jobs).poll_next(cx) { + return Poll::Ready(response); } Poll::Pending