mirror of
https://github.com/volatilityfoundation/volatility3.git
synced 2026-09-27 03:54:49 +02:00
Numerous pycharm warnings resolved
This includes: * Better ways of checking empty lists * Not shadowing builtin functions like filter * Preventing invalid slash warnings by marking strings as regexps * Removing unnecessary brackets * Lowercase variable names * Adding/updating parameters in docstrings * Removing unused code (lines not chunks) * Change in not a member tests * Changing some methods to static * Shorting range membership checks * Missing parameters * Make some exception handlers more specific * Don't define a lambda to a variable * A few more instance checks to help type checkers
This commit is contained in:
@@ -249,7 +249,7 @@ class TreeGrid(interfaces.renderers.TreeGrid):
|
||||
newpath = parent_path + str(position)
|
||||
tree_item = TreeNode(newpath, self, parent, values)
|
||||
for node, _ in children[position:]:
|
||||
self.visit(node, lambda child, _: child.path_changed(newpath, True))
|
||||
self.visit(node, lambda child, _: child.path_changed(newpath, True), None)
|
||||
children.insert(position, (tree_item, []))
|
||||
return tree_item
|
||||
|
||||
@@ -259,7 +259,7 @@ class TreeGrid(interfaces.renderers.TreeGrid):
|
||||
|
||||
def max_depth(self):
|
||||
"""Returns the maximum depth of the tree"""
|
||||
return self.visit(None, lambda n, a: max(a, self.path_depth(n)), )
|
||||
return self.visit(None, lambda n, a: max(a, self.path_depth(n)), 0)
|
||||
|
||||
_T = TypeVar("_T")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user