Refactor encoding to use *string instead of string as input
I don't want to clone the whole input string
This commit is contained in:
@@ -4,8 +4,9 @@ import "bytes"
|
||||
|
||||
type ASCIICoder struct{}
|
||||
|
||||
func (c *ASCIICoder) Encode(s string, buf *bytes.Buffer) error {
|
||||
buf.WriteString(s)
|
||||
func (c *ASCIICoder) Encode(s *string, buf *bytes.Buffer) error {
|
||||
// These should be ASCII but UTF8 is a superset of ASCII so hopefully this'll be fine
|
||||
buf.WriteString(*s)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user