internal: refactor to use empty() (#10599)

This commit is contained in:
Kamikadze 2025-05-31 23:49:50 +05:00 committed by GitHub
parent 4078e1d17c
commit 69c2b2926e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 57 additions and 57 deletions

View file

@ -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) {