Skip to content

Commit 4e0142e

Browse files
authored
Merge pull request #22469 from nkcsgexi/address-comments
SwiftSyntax: address some post-commit review comments
2 parents 12ef6ea + a9f9f3d commit 4e0142e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

utils/gyb_syntax_support/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,26 +145,26 @@ def dedented_lines(description):
145145

146146
def hash_syntax_node(node):
147147
# Hash into the syntax name and serialization code
148-
result = hash((node.name, str(get_serialization_code(node.syntax_kind))))
148+
result = hash((node.name, get_serialization_code(node.syntax_kind)))
149149
for child in node.children:
150150
# Hash into the expected child syntax
151151
result = hash((result, child.syntax_kind))
152152
# Hash into the child name
153153
result = hash((result, child.name))
154154
# Hash into whether the child is optional
155-
result = hash((result, str(child.is_optional)))
155+
result = hash((result, child.is_optional))
156156
return result
157157

158158

159159
def hash_token_syntax(token):
160160
# Hash into the token name and serialization code
161-
return hash((token.name, str(token.serialization_code)))
161+
return hash((token.name, token.serialization_code))
162162

163163

164164
def calculate_node_hash():
165165
result = 0
166166
for node in SYNTAX_NODES:
167-
result = hash((result, hash_syntax_node(node=node)))
167+
result = hash((result, hash_syntax_node(node)))
168168
for token in SYNTAX_TOKENS:
169-
result = hash((result, hash_token_syntax(token=token)))
169+
result = hash((result, hash_token_syntax(token)))
170170
return result

0 commit comments

Comments
 (0)