From 974b4b337701b6cdab6e7eccf84002288be21c70 Mon Sep 17 00:00:00 2001 From: thurs Date: Wed, 1 Apr 2026 11:22:49 -0700 Subject: [PATCH] fix: remove { } from short if's --- src/config/ConfigManager.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index cc7e8b2..93ad0a4 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -12,17 +12,15 @@ static std::expected getMainConfigPath(const std:: if (!overridePath.empty()) { std::error_code ec; - if (!fs::exists(overridePath, ec)) { + if (!fs::exists(overridePath, ec)) return std::unexpected(std::make_error_code(std::errc::no_such_file_or_directory)); - } return overridePath; } static const auto paths = Hyprutils::Path::findConfig("hypridle"); - if (paths.first.has_value()) { + if (paths.first.has_value()) return paths.first.value(); - } return std::unexpected(std::make_error_code(std::errc::no_such_file_or_directory)); } @@ -35,9 +33,8 @@ CConfigManager::CConfigManager(std::string configPath) : { auto pathResult = getMainConfigPath(configPath); - if (!pathResult) { + if (!pathResult) return; - } configCurrentPath = *pathResult; configHeadPath = configCurrentPath; @@ -134,9 +131,9 @@ std::vector CConfigManager::getRules() { } std::optional CConfigManager::handleSource(const std::string& command, const std::string& rawpath) { - if (rawpath.length() < 2) { + if (rawpath.length() < 2) return "source path " + rawpath + " bogus!"; - } + std::unique_ptr glob_buf{new glob_t, [](glob_t* g) { globfree(g); }}; memset(glob_buf.get(), 0, sizeof(glob_t));