only add new_children (marginally faster)
This commit is contained in:
parent
a4b5776208
commit
89bd1e6abe
1 changed files with 1 additions and 1 deletions
|
|
@ -915,7 +915,7 @@ class Pattern:
|
||||||
def get_children(pat: Pattern, memo: Set) -> Set:
|
def get_children(pat: Pattern, memo: Set) -> Set:
|
||||||
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 |= new_children
|
||||||
|
|
||||||
for child_pat in new_children:
|
for child_pat in new_children:
|
||||||
memo |= get_children(child_pat, memo)
|
memo |= get_children(child_pat, memo)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue