Skip to content

Commit b097d44

Browse files
committed
Remove set generation methods from Scope
Prior to this change, we had replaced all callers with the query equivalents. This provides a considerable performance improvement when compiling large files, as we are no longer repeatedly creating new sets. This change removes the unused methods which generated the sets as they are no longer needed (and are a footgun).
1 parent d83beb6 commit b097d44

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

src/fluent_compiler/codegen.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,6 @@ def __init__(self, parent_scope=None):
116116
self._properties = {}
117117
self._assignments = {}
118118

119-
def names_in_use(self):
120-
names = self.names
121-
if self.parent_scope is not None:
122-
names = names | self.parent_scope.names_in_use()
123-
return names
124-
125119
def is_name_in_use(self, name: str) -> bool:
126120
if name in self.names:
127121
return True
@@ -131,12 +125,6 @@ def is_name_in_use(self, name: str) -> bool:
131125

132126
return self.parent_scope.is_name_in_use(name)
133127

134-
def function_arg_reserved_names(self):
135-
names = self._function_arg_reserved_names
136-
if self.parent_scope is not None:
137-
names = names | self.parent_scope.function_arg_reserved_names()
138-
return names
139-
140128
def is_name_reserved_function_arg(self, name: str) -> bool:
141129
if name in self._function_arg_reserved_names:
142130
return True
@@ -146,9 +134,6 @@ def is_name_reserved_function_arg(self, name: str) -> bool:
146134

147135
return self.parent_scope.is_name_reserved_function_arg(name)
148136

149-
def all_reserved_names(self):
150-
return self.names_in_use() | self.function_arg_reserved_names()
151-
152137
def is_name_reserved(self, name: str) -> bool:
153138
return self.is_name_in_use(name) or self.is_name_reserved_function_arg(name)
154139

0 commit comments

Comments
 (0)