Chore: uses elvis operators where applicatable

This commit is contained in:
李通洲
2026-01-22 09:06:23 +08:00
committed by Carter Li
parent 8f082730a8
commit c116a5abdf
3 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -61,7 +61,7 @@ bool ffParseModuleOptions(const char* key, const char* value)
}
fprintf(stderr, "Error: Unsupported module option: %s\n", key);
fputs(" Support of module options has been removed. Please add the flag to the JSON config instead.\n", stderr);
fprintf(stderr, " Example (demonstration only): `{ \"modules\": [ { \"type\": \"%s\", \"%s\": %s%s%s } ] }`\n", moduleName.chars, jsonKey.chars, value ? "\"" : "", value ? value : "true", value ? "\"" : "");
fprintf(stderr, " Example (demonstration only): `{ \"modules\": [ { \"type\": \"%s\", \"%s\": %s%s%s } ] }`\n", moduleName.chars, jsonKey.chars, value ? "\"" : "", value ?: "true", value ? "\"" : "");
fputs(" See <https://github.com/fastfetch-cli/fastfetch/wiki/Configuration> for more information.\n", stderr);
exit(477);
}
+1 -1
View File
@@ -560,7 +560,7 @@ static const char* detectOf(FFlist* gpus, FFstrbuf* buffer, FFstrbuf* drmDir, co
if (!gpu->name.length)
{
ffStrbufSetS(&gpu->name, name ? name : compatible);
ffStrbufSetS(&gpu->name, name ?: compatible);
ffStrbufTrimRightSpace(&gpu->name);
}
if (!gpu->vendor.length && name)
+2 -2
View File
@@ -307,10 +307,10 @@ void ffLogoPrintChars(const char* data, bool doColorReplacement)
static void logoApplyColors(const FFlogo* logo, bool replacement)
{
if(instance.config.display.colorTitle.length == 0)
ffStrbufAppendS(&instance.config.display.colorTitle, logo->colorTitle ? logo->colorTitle : logo->colors[0]);
ffStrbufAppendS(&instance.config.display.colorTitle, logo->colorTitle ?: logo->colors[0]);
if(instance.config.display.colorKeys.length == 0)
ffStrbufAppendS(&instance.config.display.colorKeys, logo->colorKeys ? logo->colorKeys : logo->colors[1]);
ffStrbufAppendS(&instance.config.display.colorKeys, logo->colorKeys ?: logo->colors[1]);
if (replacement)
{