From fafbbb4996ae0e148172b30e25699e55990cd2ee Mon Sep 17 00:00:00 2001 From: CrisMystik <62919067+CrisMystik@users.noreply.github.com> Date: Mon, 25 Apr 2022 21:34:43 +0200 Subject: [PATCH] Suggested code improvements --- Telegram/SourceFiles/core/local_url_handlers.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/core/local_url_handlers.cpp b/Telegram/SourceFiles/core/local_url_handlers.cpp index 2803307d0f..b1e2a91a85 100644 --- a/Telegram/SourceFiles/core/local_url_handlers.cpp +++ b/Telegram/SourceFiles/core/local_url_handlers.cpp @@ -448,7 +448,7 @@ bool ResolveSettings( controller->window().activate(); const auto section = match->captured(1).mid(1).toLower(); - const auto getSectionType = [&]() -> std::optional<::Settings::Type> { + const auto type = [&]() -> std::optional<::Settings::Type> { if (section.isEmpty()) { return ::Settings::Main::Id(); } else if (section == qstr("language")) { @@ -466,9 +466,9 @@ bool ResolveSettings( return ::Settings::ChangePhone::Id(); } return {}; - }; + }(); - if (const auto type = getSectionType()) { + if (type.has_value()) { controller->showSettings(*type); controller->window().activate(); }