"vscode:/vscode.git/clone" did not exist on "b379dbd6c8adda9010dac1e481a872d72cf91175"
Unverified Commit e6692bf4 authored by luzengxiangcn's avatar luzengxiangcn Committed by GitHub
Browse files

debug radixcache stack_overflow (#1499)

parent 28b4d8e1
......@@ -291,15 +291,15 @@ class RadixCache(BasePrefixCache):
def _collect_leaves(self):
ret_list = []
stack = [self.root_node]
def dfs_(cur_node):
while stack:
cur_node = stack.pop()
if len(cur_node.children) == 0:
ret_list.append(cur_node)
else:
stack.extend(cur_node.children.values())
for x in cur_node.children.values():
dfs_(x)
dfs_(self.root_node)
return ret_list
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment