lesismal / nbio

Pure Go 1000k+ connections solution, support tls/http1.x/websocket and basically compatible with net/http, with high-performance and low memory cost, non-blocking, event-driven, easy-to-use.
MIT License
2.11k stars 151 forks source link

refactor: use defer c.mux.Unlock in ReadAndGetConn() #429

Closed byene0923 closed 2 months ago

byene0923 commented 2 months ago

ReadAndGetConn() use c.mux lock whole function. maybe can use defer c.mux.Unlock()?

lesismal commented 2 months ago

defer costs a few more nanoseconds, no need to use defer at these simple funcs