Edit the filter in the TreeDirNode glob method

A better style for executing the removal of each filtered name was
chosen. This is a minor change, but I viewed it as necessary.
This commit is contained in:
Jason Franklin 2017-06-27 11:10:52 -04:00
parent 2a97fb0fda
commit 779e13374a

View File

@ -256,7 +256,6 @@ function! s:TreeDirNode._glob(pattern, all)
" If "a:all" is false, filter "." and ".." from the output.
if !a:all
let l:toRemove = []
for l:file in l:globList
@ -275,10 +274,9 @@ function! s:TreeDirNode._glob(pattern, all)
endif
endfor
if !empty(l:toRemove)
call remove(l:globList, index(l:globList, l:toRemove[0]))
call remove(l:globList, index(l:globList, l:toRemove[1]))
endif
for l:file in l:toRemove
call remove(l:globList, index(l:globList, l:file))
endfor
endif
return l:globList