From 2ac25bcc7fa9caf004ba2854ce35a27cd5886431 Mon Sep 17 00:00:00 2001 From: Andy Pan Date: Mon, 5 Feb 2024 16:24:56 +0800 Subject: [PATCH] chore: update code --- connection_bsd.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/connection_bsd.go b/connection_bsd.go index 9739683c4..507f636df 100644 --- a/connection_bsd.go +++ b/connection_bsd.go @@ -37,10 +37,8 @@ func (c *conn) handleEvents(_ int, filter int16, flags uint16) (err error) { } case filter == netpoll.EVFilterRead: err = c.loop.read(c) - case filter == netpoll.EVFilterWrite: - if !c.outboundBuffer.IsEmpty() { - err = c.loop.write(c) - } + case filter == netpoll.EVFilterWrite && !c.outboundBuffer.IsEmpty(): + err = c.loop.write(c) } return }