summaryrefslogtreecommitdiff
path: root/src/utils/cpp/tmp_dir.cpp
diff options
context:
space:
mode:
authorMaksim Denisov <denisov.maksim@huawei.com>2025-04-22 11:09:17 +0200
committerMaksim Denisov <denisov.maksim@huawei.com>2025-04-22 13:50:57 +0200
commita212d87be891c5146021b6442063ed39a4a1cd4a (patch)
tree9df2902cf7f8bf9d70917ab87865517e9bdc71c3 /src/utils/cpp/tmp_dir.cpp
parentba51f59519847a3d298fd176d93a0b6c64f452c1 (diff)
downloadjustbuild-a212d87be891c5146021b6442063ed39a4a1cd4a.tar.gz
Remove redundant calls to std::filesystem::absolute
...when calling std::filesystem::weakly_canonical, since the latter converts the argument path to an absolute path internally.
Diffstat (limited to 'src/utils/cpp/tmp_dir.cpp')
-rw-r--r--src/utils/cpp/tmp_dir.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/utils/cpp/tmp_dir.cpp b/src/utils/cpp/tmp_dir.cpp
index 9a38aca2..2a43cacd 100644
--- a/src/utils/cpp/tmp_dir.cpp
+++ b/src/utils/cpp/tmp_dir.cpp
@@ -49,8 +49,8 @@ auto TmpDir::CreateFile(TmpDir::Ptr const& parent,
}
try {
- auto file_path = std::filesystem::weakly_canonical(
- std::filesystem::absolute(temp_dir->GetPath() / file_name));
+ auto file_path =
+ std::filesystem::weakly_canonical(temp_dir->GetPath() / file_name);
if (not FileSystemManager::CreateFile(file_path)) {
return nullptr;
}
@@ -75,8 +75,7 @@ auto TmpDir::CreateImpl(TmpDir::Ptr parent,
std::string file_path;
try {
- file_path = std::filesystem::weakly_canonical(
- std::filesystem::absolute(path / kDirTemplate));
+ file_path = std::filesystem::weakly_canonical(path / kDirTemplate);
// Create a temporary directory:
if (mkdtemp(file_path.data()) == nullptr) {
return nullptr;