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/other_tools/git_operations/git_operations.cpp | |
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/other_tools/git_operations/git_operations.cpp')
-rw-r--r-- | src/other_tools/git_operations/git_operations.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/other_tools/git_operations/git_operations.cpp b/src/other_tools/git_operations/git_operations.cpp index 5135743f..be6d9ce1 100644 --- a/src/other_tools/git_operations/git_operations.cpp +++ b/src/other_tools/git_operations/git_operations.cpp @@ -63,7 +63,7 @@ auto CriticalGitOps::GitInitialCommit(GitOpParams const& crit_op_params, return {.git_cas = nullptr, .result = std::nullopt}; } // success - return {.git_cas = git_repo->GetGitCAS(), .result = commit_hash.value()}; + return {.git_cas = git_repo->GetGitCAS(), .result = std::move(commit_hash)}; } auto CriticalGitOps::GitEnsureInit(GitOpParams const& crit_op_params, @@ -132,7 +132,7 @@ auto CriticalGitOps::GitKeepTag(GitOpParams const& crit_op_params, return {.git_cas = nullptr, .result = std::nullopt}; } // success - return {.git_cas = git_repo->GetGitCAS(), .result = *tag_result}; + return {.git_cas = git_repo->GetGitCAS(), .result = std::move(tag_result)}; } auto CriticalGitOps::GitGetHeadId(GitOpParams const& crit_op_params, @@ -165,7 +165,7 @@ auto CriticalGitOps::GitGetHeadId(GitOpParams const& crit_op_params, return {.git_cas = nullptr, .result = std::nullopt}; } // success - return {.git_cas = git_repo->GetGitCAS(), .result = *head_commit}; + return {.git_cas = git_repo->GetGitCAS(), .result = std::move(head_commit)}; } auto CriticalGitOps::GitKeepTree(GitOpParams const& crit_op_params, @@ -208,5 +208,5 @@ auto CriticalGitOps::GitKeepTree(GitOpParams const& crit_op_params, return {.git_cas = nullptr, .result = std::nullopt}; } // success - return {.git_cas = git_repo->GetGitCAS(), .result = *tag_result}; + return {.git_cas = git_repo->GetGitCAS(), .result = std::move(tag_result)}; } |