Skip to content

Commit

Permalink
feat: allocate larger map (jordan-wright#98)
Browse files Browse the repository at this point in the history
I counted the fields being set and they are generally more than four
items.
  • Loading branch information
JensRantil authored Mar 7, 2020
1 parent a0b5c5b commit 8de9728
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion email.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ func (e *Email) AttachFile(filename string) (a *Attachment, err error) {
// "e"'s fields To, Cc, From, Subject will be used unless they are present in
// e.Headers. Unless set in e.Headers, "Date" will filled with the current time.
func (e *Email) msgHeaders() (textproto.MIMEHeader, error) {
res := make(textproto.MIMEHeader, len(e.Headers)+4)
res := make(textproto.MIMEHeader, len(e.Headers)+6)
if e.Headers != nil {
for _, h := range []string{"Reply-To", "To", "Cc", "From", "Subject", "Date", "Message-Id", "MIME-Version"} {
if v, ok := e.Headers[h]; ok {
Expand Down

0 comments on commit 8de9728

Please sign in to comment.