Skip to content

Commit

Permalink
Avoid recomputing tmp path
Browse files Browse the repository at this point in the history
Signed-off-by: Anna Rift <[email protected]>
  • Loading branch information
riftEmber committed Nov 25, 2024
1 parent 5e4e9a9 commit 87c6100
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion compiler/util/files.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,10 @@ void restoreDriverTmp(const char* tmpFilePath,
// Create file iff it did not already exist, for simpler reading logic in the
// rest of the function.
fileinfo* tmpFileDummy = openTmpFile(tmpFilePath, "a");
const char* path = tmpFileDummy->pathname;
closefile(tmpFileDummy);

std::ifstream fileStream(genIntermediateFilename(tmpFilePath));
std::ifstream fileStream(path);
std::string line;
while (std::getline(fileStream, line)) {
restoreSavedString(line.c_str());
Expand Down

0 comments on commit 87c6100

Please sign in to comment.