src: clang-tidy

This commit is contained in:
Austin Horstman
2024-07-02 10:12:41 -05:00
parent 9997155617
commit 14c3235c12
9 changed files with 62 additions and 59 deletions

View File

@ -21,10 +21,10 @@ const std::vector<std::string> Config::CONFIG_DIRS = {
const char *Config::CONFIG_PATH_ENV = "WAYBAR_CONFIG_DIR";
std::optional<std::string> tryExpandPath(const std::string base, const std::string filename) {
std::optional<std::string> tryExpandPath(const std::string &base, const std::string &filename) {
fs::path path;
if (filename != "") {
if (!filename.empty()) {
path = fs::path(base) / fs::path(filename);
} else {
path = fs::path(base);
@ -129,9 +129,9 @@ bool isValidOutput(const Json::Value &config, const std::string &name,
if (config_output.substr(0, 1) == "!") {
if (config_output.substr(1) == name || config_output.substr(1) == identifier) {
return false;
} else {
continue;
}
continue;
}
if (config_output == name || config_output == identifier) {
return true;
@ -142,7 +142,9 @@ bool isValidOutput(const Json::Value &config, const std::string &name,
}
}
return false;
} else if (config["output"].isString()) {
}
if (config["output"].isString()) {
auto config_output = config["output"].asString();
if (!config_output.empty()) {
if (config_output.substr(0, 1) == "!") {