Skip to content

Commit 17e69fe

Browse files
committed
#72 Initialize the permessage, keystrings, and readslices using make()
1 parent 2feb570 commit 17e69fe

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lhost/via-courier.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ func init() {
5050
"networkerror": []string{"DNS lookup failed."},
5151
}
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
emailparts := rfc5322.Part(&bf.Payload, boundaries, false)
57-
readcursor := uint8(0) // Points the current cursor position
58-
readslices := []string{""} // Copy each line for later reference
59-
recipients := uint8(0) // The number of 'Final-Recipient' header
60-
thecommand := "" // An SMTP command name begins with the string ">>>"
57+
readcursor := uint8(0) // Points the current cursor position
58+
readslices := make([]string, 1, 64) // Copy each line for later reference
59+
recipients := uint8(0) // The number of 'Final-Recipient' header
60+
thecommand := "" // An SMTP command name begins with the string ">>>"
6161
v := &(dscontents[len(dscontents) - 1])
6262

6363
for j, e := range(strings.Split(emailparts[0], "\n")) {

0 commit comments

Comments
 (0)