[PATCH] D82542: [Support][Windows] Prevent 2s delay when renaming a file that does not exist

Adrian McCarthy via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 25 11:54:29 PDT 2020


amccarth added a comment.

rnk is on leave, so I'll jump in.

This is correct, but I have a small suggestion inline to make it more robust against future changes.



================
Comment at: llvm/lib/Support/Windows/Path.inc:562
+    if (EC == errc::no_such_file_or_directory)
+      break;
   }
----------------
I would probably just `return` the error here rather than `break`.

When you break, you end up calling `GetLastError()` again.  While that's probably safe, a small future change could end perturb that last error code.




CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D82542/new/

https://reviews.llvm.org/D82542





More information about the llvm-commits mailing list