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): ...@@ -291,15 +291,15 @@ class RadixCache(BasePrefixCache):
def _collect_leaves(self): def _collect_leaves(self):
ret_list = [] ret_list = []
stack = [self.root_node]
def dfs_(cur_node): while stack:
cur_node = stack.pop()
if len(cur_node.children) == 0: if len(cur_node.children) == 0:
ret_list.append(cur_node) 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 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