PeopleModel: various performance tweaks

svn: r12711
This commit is contained in:
Gerald Britton 2009-06-25 19:15:56 +00:00
parent 4cd2468477
commit 3a41651e50

View File

@ -140,12 +140,13 @@ class NodeTreeMap(object):
return node in self.sname_sub
def find_next_node(self, node):
try:
if node in self.top_iter2path:
path = self.top_iter2path[node]
if path+1 == len(self.top_path2iter):
if path+1 < len(self.top_path2iter):
return self.top_path2iter[path+1]
else:
return None
return self.top_path2iter[path+1]
except:
else:
(surname, val) = self.iter2path[node]
return self.path2iter.get((surname, val+1))