Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I noticed this in mediocregopher#84. The only (non-stub) implementation of Conn.NetConn currently wraps the net.Conn in a connLimited which prevents calls to Read, Write and Close, but also causes an allocation. As noted in the issue, this is unnecessary and goes against the general way of handling these kind of restrictions in the package which is just documenting what is not allowed instead of trying to prevent the user from doing stupid things. They will always find a way anyway, so no need to be too preventive / defensive here. Since the Conn.NetConn documentation already forbis calling these methods we can just remove the wrapping altogether and avoid the allocation. No new benchmark since this is not an important change and we got some numbers in mediocregopher#84. Updates mediocregopher#84
- Loading branch information