From 5baab75fd2ae62b6f6407991922fe234f9e73c88 Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Thu, 26 Sep 2024 14:20:16 +0200 Subject: Fix redundant std::optional conversions ...proposed by clang-tidy. Enable bugprone-optional-value-conversion check. --- src/other_tools/git_operations/git_config_settings.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/other_tools/git_operations/git_config_settings.cpp') diff --git a/src/other_tools/git_operations/git_config_settings.cpp b/src/other_tools/git_operations/git_config_settings.cpp index c820aa32..b0fe27bc 100644 --- a/src/other_tools/git_operations/git_config_settings.cpp +++ b/src/other_tools/git_operations/git_config_settings.cpp @@ -327,7 +327,7 @@ auto GitConfigSettings::GetProxySettings(std::shared_ptr const& cfg, true /*fatal*/); return std::nullopt; } - return proxy_info.value(); + return proxy_info; } } // check the generic "http.proxy" gitconfig entry; @@ -348,7 +348,7 @@ auto GitConfigSettings::GetProxySettings(std::shared_ptr const& cfg, true /*fatal*/); return std::nullopt; } - return proxy_info.value(); + return proxy_info; } // cleanup memory git_buf_dispose(&tmp_buf); @@ -376,7 +376,7 @@ auto GitConfigSettings::GetProxySettings(std::shared_ptr const& cfg, true /*fatal*/); return std::nullopt; } - return proxy_info.value(); + return proxy_info; } // check HTTPS_PROXY envariable if (const char* envar = std::getenv("HTTPS_PROXY")) { @@ -390,7 +390,7 @@ auto GitConfigSettings::GetProxySettings(std::shared_ptr const& cfg, true /*fatal*/); return std::nullopt; } - return proxy_info.value(); + return proxy_info; } } else if (url_scheme.value() == "http") { @@ -406,7 +406,7 @@ auto GitConfigSettings::GetProxySettings(std::shared_ptr const& cfg, true /*fatal*/); return std::nullopt; } - return proxy_info.value(); + return proxy_info; } } // check all_proxy envariable @@ -421,7 +421,7 @@ auto GitConfigSettings::GetProxySettings(std::shared_ptr const& cfg, true /*fatal*/); return std::nullopt; } - return proxy_info.value(); + return proxy_info; } // check ALL_PROXY envariable if (const char* envar = std::getenv("ALL_PROXY")) { @@ -435,7 +435,7 @@ auto GitConfigSettings::GetProxySettings(std::shared_ptr const& cfg, true /*fatal*/); return std::nullopt; } - return proxy_info.value(); + return proxy_info; } } } -- cgit v1.2.3