summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
6e5794e)
Instead of recording which sections have been visited, record all
sections which have been pushed and avoid pushing them again. This
reduces pointless stack activity.
## Initialize for a depth-first walk of the inheritance graph.
seen = {}
## Initialize for a depth-first walk of the inheritance graph.
seen = {}
+ visiting = { me.name: True }
stack = [me]
## Visit nodes, collecting their keys. Don't believe the values:
## resolving inheritance is too hard to do like this.
while stack:
sec = stack.pop()
stack = [me]
## Visit nodes, collecting their keys. Don't believe the values:
## resolving inheritance is too hard to do like this.
while stack:
sec = stack.pop()
- if sec.name in visited: continue
- visited[sec.name] = True
- stack += sec._parents()
+ for p in sec._parents():
+ if p.name not in visiting:
+ stack.append(p); visiting[p.name] = True
for key in sec._itemmap.iterkeys():
if key != '@inherit': seen[key] = None
for key in sec._itemmap.iterkeys():
if key != '@inherit': seen[key] = None