Fix/simplify loop conditions in Windows GetTempPath.
Missed when I ran unit tests, since those take the earlier path with TEST_TMPDIR.
The resize trims a '\0' off of the string, but it's stored in a std::string so that's fine?
PiperOrigin-RevId: 314375083
diff --git a/iree/base/internal/file_io_win32.cc b/iree/base/internal/file_io_win32.cc
index 1dc1673..6b2e02e 100644
--- a/iree/base/internal/file_io_win32.cc
+++ b/iree/base/internal/file_io_win32.cc
@@ -101,7 +101,7 @@
}
std::string temp_path(64, '\0');
- for (bool retry_query = false; retry_query && !temp_path.empty();) {
+ for (bool retry_query = true; retry_query;) {
DWORD required_length = ::GetTempPathA(temp_path.size(), &temp_path[0]);
retry_query = required_length > temp_path.size();
temp_path.resize(required_length);