Skip to content

Commit 2c153f6

Browse files
committed
Swift: replace processed with seen in module visiting
1 parent d5af30d commit 2c153f6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

swift/extractor/SwiftExtractor.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ void codeql::extractSwiftFiles(const SwiftExtractorConfiguration& config,
180180
swift::CompilerInstance& compiler) {
181181
auto inputFiles = collectInputFilenames(compiler);
182182
std::vector<swift::ModuleDecl*> todo = {compiler.getMainModule()};
183-
std::unordered_set<swift::ModuleDecl*> processed = {};
183+
std::unordered_set<swift::ModuleDecl*> seen = {compiler.getMainModule()};
184184

185185
while (!todo.empty()) {
186186
auto module = todo.back();
@@ -203,10 +203,10 @@ void codeql::extractSwiftFiles(const SwiftExtractorConfiguration& config,
203203
if (!isFromSourceFile) {
204204
encounteredModules = extractDeclarations(config, compiler, *module);
205205
}
206-
processed.insert(module);
207206
for (auto encountered : encounteredModules) {
208-
if (processed.count(encountered) == 0) {
207+
if (seen.count(encountered) == 0) {
209208
todo.push_back(encountered);
209+
seen.insert(encountered);
210210
}
211211
}
212212
}

0 commit comments

Comments
 (0)