Skip to content

Commit

Permalink
Merge pull request #428 from byene0923/fix/remove_useless_check
Browse files Browse the repository at this point in the history
refactor: remove useless n > 0 check in flush()
  • Loading branch information
lesismal authored May 7, 2024
2 parents d31ce3e + a94ac0a commit 89ba141
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion conn_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ func (c *Conn) flush() error {
for len(buf) > 0 && err == nil {
n, err = syscall.Write(c.fd, buf)
if n > 0 {
if c.p.g.onWrittenSize != nil && n > 0 {
if c.p.g.onWrittenSize != nil {
c.p.g.onWrittenSize(c, buf[:n], n)
}
c.left -= n
Expand Down

0 comments on commit 89ba141

Please sign in to comment.