Don't return early, since we add patterns to memo before they've been checked
This commit is contained in:
parent
0589fbb1b8
commit
a4b5776208
@ -913,9 +913,6 @@ class Pattern:
|
|||||||
A filtered list in which no pattern is referenced by any other pattern.
|
A filtered list in which no pattern is referenced by any other pattern.
|
||||||
"""
|
"""
|
||||||
def get_children(pat: Pattern, memo: Set) -> Set:
|
def get_children(pat: Pattern, memo: Set) -> Set:
|
||||||
if pat in memo:
|
|
||||||
return memo
|
|
||||||
|
|
||||||
children = set(sp.pattern for sp in pat.subpatterns if sp.pattern is not None)
|
children = set(sp.pattern for sp in pat.subpatterns if sp.pattern is not None)
|
||||||
new_children = children - memo
|
new_children = children - memo
|
||||||
memo |= children
|
memo |= children
|
||||||
|
Loading…
Reference in New Issue
Block a user