Closed slingamn closed 1 year ago
https://github.com/ergochat/ergo/blob/4317016a09a2629603fb6198cbeddf6afa28c8ce/irc/ircconn.go#L131
ReadMessage() allocates a temporary buffer for each message; we could instead use NextReader() and copy the results into a persistent buffer. (The contract for (IRCConn).ReadLine() only requires the resulting bytes to be valid until the next call.)
ReadMessage()
NextReader()
(IRCConn).ReadLine()
Done in #2038
https://github.com/ergochat/ergo/blob/4317016a09a2629603fb6198cbeddf6afa28c8ce/irc/ircconn.go#L131
ReadMessage()
allocates a temporary buffer for each message; we could instead useNextReader()
and copy the results into a persistent buffer. (The contract for(IRCConn).ReadLine()
only requires the resulting bytes to be valid until the next call.)