massive performance++

This commit is contained in:
Daniella / Tove 2023-10-08 14:31:47 +02:00
parent 551addfdf5
commit 43d208a39f
Signed by: TudbuT
GPG key ID: 7D63D5634B7C417F

View file

@ -147,6 +147,9 @@ impl Connection {
self.is_nb self.is_nb
} }
pub fn set_nonblocking(&mut self, nonblocking: bool) -> io::Result<()> { pub fn set_nonblocking(&mut self, nonblocking: bool) -> io::Result<()> {
if self.is_nb == nonblocking {
return Ok(());
}
self.is_nb = nonblocking; self.is_nb = nonblocking;
(self.set_nonblocking_thunk)(self.data, nonblocking) (self.set_nonblocking_thunk)(self.data, nonblocking)
} }