Skip to content

Commit e9acaaa

Browse files
committed
Avoid const lookup for ancestors.append and path.append as well.
1 parent 3378679 commit e9acaaa

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

graphql/core/language/visitor.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ def visit(root, visitor, key_map=None):
3636
enter = visitor.enter
3737
path_pop = path.pop
3838
ancestors_pop = ancestors.pop
39+
path_append = path.append
40+
ancestors_append = ancestors.append
3941

4042
while True:
4143
index += 1
@@ -92,7 +94,7 @@ def visit(root, visitor, key_map=None):
9294
continue
9395

9496
if parent:
95-
path.append(key)
97+
path_append(key)
9698

9799
result = None
98100

@@ -135,7 +137,7 @@ def visit(root, visitor, key_map=None):
135137
edits = []
136138

137139
if parent:
138-
ancestors.append(parent)
140+
ancestors_append(parent)
139141

140142
parent = node
141143

0 commit comments

Comments
 (0)