Skip to content

Commit a7438d9

Browse files
committed
#72 Initialize the permessage, keystrings, and readslices using make()
1 parent 2638b2d commit a7438d9

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

rfc3464/lib.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,16 @@ func Inquire(bf *sis.BeforeFact) sis.RisingUnderway {
5050
bf.Payload = strings.Replace(bf.Payload, cv, "\n\n" + boundaries[0] + cv, 1)
5151
break
5252
}
53-
permessage := map[string]string{} // Store values of each Per-Message field
54-
keystrings := []string{} // Key list of permessage
53+
permessage := make(map[string]string, 4) // Store values of each Per-Message field
54+
keystrings := make([]string, 0, 4) // Key list of permessage
5555
dscontents := []sis.DeliveryMatter{{}}
5656
alternates := sis.DeliveryMatter{}
5757
emailparts := rfc5322.Part(&bf.Payload, boundaries, false)
58-
readcursor := uint8(0) // Points the current cursor position
59-
readslices := []string{""} // Copy each line for later reference
60-
recipients := uint8(0) // The number of 'Final-Recipient' header
61-
beforemesg := "" // String before startingof["message"]
62-
goestonext := false // Flag: do not append the line into "beforemesg"
58+
readcursor := uint8(0) // Points the current cursor position
59+
readslices := make([]string, 1, 64) // Copy each line for later reference
60+
recipients := uint8(0) // The number of 'Final-Recipient' header
61+
beforemesg := "" // String before startingof["message"]
62+
goestonext := false // Flag: do not append the line into "beforemesg"
6363
isboundary := []string{rfc2045.Boundary(bf.Headers["content-type"][0], 0)}
6464
v := &(dscontents[len(dscontents) - 1])
6565

0 commit comments

Comments
 (0)