ftp: minor optimization in dir() (#8518)

pull/8478/head^2
yuyi 2021-02-03 01:51:55 +08:00 committed by GitHub
parent 9f662002da
commit 91af2418de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -221,8 +221,7 @@ pub fn (mut zftp FTP) dir() ?[]string {
sdir := list_dir.bytestr()
for lfile in sdir.split('\n') {
if lfile.len > 1 {
spl := lfile.split(' ')
dir << spl[spl.len - 1].trim_space()
dir << lfile.after(' ').trim_space()
}
}
return dir