net/textproto: seemingly unnecssary buffer copy and reassignment in Reader.ReadLineBytes #28436
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
I was just studying up and working on some small net/http performance changes and while examining its dependencies stumbled upon net/textproto (*Reader).ReadLineBytes()
go/src/net/textproto/reader.go
Lines 40 to 49 in bc4a10d
The source code was last edited 7 years ago in 27a3dcd and am wondering whether the code in question is just a vestige of the old days or if perhaps there is a subtle reason behind that copy and reassignment
I believe that code should just replace that for (*Reader) readLineSlice
that is
If there is a reason behind it, let's please document it with a comment. In the standard library I can't find any usage of ReadLineBytes so perhaps that might be the reason why no one had noticed?
/cc @bradfitz @rsc please feel free to correct me if am mistaken.
The text was updated successfully, but these errors were encountered: