@@ -23,19 +23,19 @@ func Find(argv1 string, argv2 string) string {
23
23
if len (argv2 ) < 1 { argv2 = " " }
24
24
25
25
givenclass := argv2 [0 :1 ]
26
- eestatuses := []string {}
26
+ eestatuses := make ( []string , 0 , 3 )
27
27
esmtperror := " " + argv1 + " " // Why 3 space characters? see https://github.com/sisimai/p5-sisimai/issues/574
28
- lookingfor := map [string ]string {}
29
- indextable := []int {}
28
+ lookingfor := make ( map [string ]string , 10 )
29
+ indextable := make ( []int , 0 , 10 )
30
30
ip4address := rfc791 .FindIPv4Address (& esmtperror )
31
31
32
32
if givenclass == "2" || givenclass == "4" || givenclass == "5" {
33
33
// The second argument is a valid value
34
- eestatuses = [] string { givenclass + "." }
34
+ eestatuses = append ( eestatuses , givenclass + "." )
35
35
36
36
} else {
37
37
// The second argument has not been specified or an invalid value
38
- eestatuses = []string {"5." , "4." , "2." }
38
+ eestatuses = append ( eestatuses , []string {"5." , "4." , "2." }... )
39
39
}
40
40
41
41
// Rewrite an IPv4 address in the given string(argv1) with '***.***.***.***'
@@ -54,8 +54,8 @@ func Find(argv1 string, argv2 string) string {
54
54
}
55
55
if len (lookingfor ) == 0 { return "" }
56
56
57
- statuscode := []string {} // List of SMTP Status Code, Keep the order of appearances
58
- anotherone := "" // Alternative code
57
+ statuscode := make ( []string , 0 , 2 ) // List of SMTP Status Code, Keep the order of appearances
58
+ anotherone := "" // Alternative code
59
59
stringsize := len (esmtperror )
60
60
61
61
sort .Slice (indextable , func (a , b int ) bool { return indextable [a ] < indextable [b ] })
0 commit comments