From 3245007f0e9c3a99040591ac8fc2a647d6ced4ee Mon Sep 17 00:00:00 2001 From: Jason Franklin Date: Fri, 14 Jul 2017 17:17:25 -0400 Subject: [PATCH] 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. --- lib/nerdtree/tree_dir_node.vim | 7 ------- 1 file changed, 7 deletions(-) diff --git a/lib/nerdtree/tree_dir_node.vim b/lib/nerdtree/tree_dir_node.vim index 5ca94d4..88ea9e6 100644 --- 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.