diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2024-09-26 14:20:16 +0200 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2024-09-26 16:54:16 +0200 |
commit | 5baab75fd2ae62b6f6407991922fe234f9e73c88 (patch) | |
tree | bc2cb07d625dc6866b0be9a1e347e51467df1703 /src/utils | |
parent | 845744929e40dbdc81ed9c7df0152d58bbb28be6 (diff) | |
download | justbuild-5baab75fd2ae62b6f6407991922fe234f9e73c88.tar.gz |
Fix redundant std::optional conversions
...proposed by clang-tidy.
Enable bugprone-optional-value-conversion check.
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/archive/archive_ops.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/utils/archive/archive_ops.cpp b/src/utils/archive/archive_ops.cpp index 8e70c814..14bbd648 100644 --- a/src/utils/archive/archive_ops.cpp +++ b/src/utils/archive/archive_ops.cpp @@ -255,7 +255,7 @@ auto ArchiveOps::CreateArchive(ArchiveType type, // enable the correct format for archive type auto res = EnableWriteFormats(a_out.get(), type); if (res != std::nullopt) { - return *res; + return res; } // open archive to write if (not FileSystemManager::CreateDirectory(destDir)) { @@ -307,7 +307,7 @@ auto ArchiveOps::CreateArchive(ArchiveType type, // write entry into archive auto res = WriteEntry(entry.get(), a_out.get()); if (res != std::nullopt) { - return *res; + return res; } } } catch (std::exception const& ex) { @@ -343,7 +343,7 @@ auto ArchiveOps::ExtractArchive(ArchiveType type, // enable support for known formats auto res = EnableReadFormats(a_in.get(), type); if (res != std::nullopt) { - return *res; + return res; } // open archive for reading if (archive_read_open_filename( @@ -392,7 +392,7 @@ auto ArchiveOps::ExtractArchive(ArchiveType type, if (archive_entry_size(entry) > 0) { auto res = CopyData(a_in.get(), disk.get()); if (res != std::nullopt) { - return *res; + return res; } } // finish entry writing |