commit 3245007f0e9c3a99040591ac8fc2a647d6ced4ee
parent a3fdf1e3c111e011af09d6d5a6b58517ea4fa6d7
Author: Jason Franklin <j_fra@fastmail.us>
Date: Fri, 14 Jul 2017 17:17:25 -0400
Remove a method from the TreeDirNode class
The "TreeDirNode.getDirChildren()" method is never called and can be
safely removed.
Further, note that this method has a bug. It calls the "filter()"
builtin function, which modifies "self.children" in-place. This is
obviously not a desirable side effect of calling this function.
If the functionality is genuinely required later, "filter()" should
be called on a copy of "self.children" to achieve the desired
result.
Diffstat:
1 file changed, 0 insertions(+), 7 deletions(-)
diff --git a/lib/nerdtree/tree_dir_node.vim b/lib/nerdtree/tree_dir_node.vim
@@ -220,13 +220,6 @@ function! s:TreeDirNode.getChildIndex(path)
return -1
endfunction
-" FUNCTION: TreeDirNode.getDirChildren() {{{1
-" Return a list of all child nodes from "self.children" that are of type
-" TreeDirNode.
-function! s:TreeDirNode.getDirChildren()
- return filter(self.children, 'v:val.path.isDirectory == 1')
-endfunction
-
" FUNCTION: TreeDirNode._glob(pattern, all) {{{1
" Return a list of strings naming the descendants of the directory in this
" TreeDirNode object that match the specified glob pattern.