From 69c2b2926e128f1fd09080aed43944987a42026f Mon Sep 17 00:00:00 2001 From: Kamikadze <40305144+Kam1k4dze@users.noreply.github.com> Date: Sat, 31 May 2025 23:49:50 +0500 Subject: internal: refactor to use empty() (#10599) --- src/debug/HyprCtl.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/debug/HyprCtl.cpp') diff --git a/src/debug/HyprCtl.cpp b/src/debug/HyprCtl.cpp index c8cc5c59..77f54c2b 100644 --- a/src/debug/HyprCtl.cpp +++ b/src/debug/HyprCtl.cpp @@ -516,7 +516,7 @@ static std::string layersRequest(eHyprCtlOutputFormat format, std::string reques trimTrailingComma(result); - if (level.size() > 0) + if (!level.empty()) result += "\n "; result += "],"; @@ -1144,7 +1144,7 @@ static std::string dispatchKeyword(eHyprCtlOutputFormat format, std::string in) Debug::log(LOG, "Hyprctl: keyword {} : {}", COMMAND, VALUE); - if (retval == "") + if (retval.empty()) return "ok"; return retval; @@ -1528,7 +1528,7 @@ static std::string dispatchPlugin(eHyprCtlOutputFormat format, std::string reque if (format == eHyprCtlOutputFormat::FORMAT_JSON) { result += "["; - if (PLUGINS.size() == 0) + if (PLUGINS.empty()) return "[]"; for (auto const& p : PLUGINS) { @@ -1546,7 +1546,7 @@ static std::string dispatchPlugin(eHyprCtlOutputFormat format, std::string reque trimTrailingComma(result); result += "]"; } else { - if (PLUGINS.size() == 0) + if (PLUGINS.empty()) return "no plugins loaded"; for (auto const& p : PLUGINS) { -- cgit v1.2.3