Skip to content

Commit c6ac386

Browse files
committed
[ModuleInterface] Address review comments.
1 parent 9d7d668 commit c6ac386

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

lib/Frontend/ParseableInterfaceSupport.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -228,9 +228,9 @@ collectDepsForSerialization(clang::vfs::FileSystem &FS,
228228
InitialDepNames.push_back(InPath);
229229
llvm::StringSet<> AllDepNames;
230230
for (auto const &DepName : InitialDepNames) {
231-
AllDepNames.insert(DepName);
232-
if (OuterTracker)
233-
OuterTracker->addDependency(DepName, /*IsSystem=*/false);
231+
if (AllDepNames.insert(DepName).second && OuterTracker) {
232+
OuterTracker->addDependency(DepName, /*IsSystem=*/false);
233+
}
234234
auto DepBuf = getBufferOfDependency(FS, InPath, DepName, Diags);
235235
if (!DepBuf) {
236236
return true;
@@ -258,8 +258,7 @@ collectDepsForSerialization(clang::vfs::FileSystem &FS,
258258
return true;
259259
}
260260
for (auto const &SubDep : SubDeps) {
261-
if (AllDepNames.count(SubDep.Path) == 0) {
262-
AllDepNames.insert(SubDep.Path);
261+
if (AllDepNames.insert(SubDep.Path).second) {
263262
Deps.push_back(SubDep);
264263
if (OuterTracker)
265264
OuterTracker->addDependency(SubDep.Path, /*IsSystem=*/false);

0 commit comments

Comments
 (0)