Pre-allocate the exact number of slice to be returned
This commit is contained in:
parent
99ba1079f9
commit
8faf9e3d75
2
ftp.go
2
ftp.go
@ -340,7 +340,7 @@ func parseRFC3659ListLine(line string) (*Entry, error) {
|
||||
// parse file or folder name with starting or containing multiple whitespaces
|
||||
func fieldsLsList(s string) []string {
|
||||
n := 8
|
||||
fields := make([]string, 0, n)
|
||||
fields := make([]string, 0, n+1)
|
||||
fieldStart := -1
|
||||
nextbreak := false
|
||||
for i, c := range s {
|
||||
|
Loading…
Reference in New Issue
Block a user