Readability and performance tweaks

svn: r13767
This commit is contained in:
Gerald Britton
2009-12-11 17:30:54 +00:00
parent fae07ee445
commit 54e5538c2d
4 changed files with 14 additions and 54 deletions

View File

@@ -403,11 +403,9 @@ class TreeBaseModel(gtk.GenericTreeModel):
path = self.on_get_path(node)
parent = self.tree[node][0]
del self.tree[node]
new_list = []
for child in self.children[parent]:
if child[1] != node:
new_list.append(child)
if len(new_list) == 0:
new_list = [child for child in self.children[parent]
if child[1] != node]
if not new_list:
del self.children[parent]
else:
self.children[parent] = new_list