Skip to content

Commit

Permalink
refactor and simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
smallnest committed Dec 24, 2023
1 parent 6ac7e27 commit 82e19a0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions epoll_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func newPollerWithBuffer(count int) (*Epoll, error) {
connBufferSize: count,
lock: &sync.RWMutex{},
conns: make(map[int]net.Conn),
connbuf: make([]net.Conn, count, count, count),
connbuf: make([]net.Conn, count, count),
}, nil
}

Expand Down Expand Up @@ -109,7 +109,7 @@ retry:

var conns []net.Conn
if e.connBufferSize == 0 {
conns := make([]net.Conn, 0, n)
conns = make([]net.Conn, 0, n)
} else {
conns = e.connbuf[:0]
}
Expand Down

0 comments on commit 82e19a0

Please sign in to comment.