Cleanup: remove duplicate null check in blf_search_by_mem_name

This commit is contained in:
Campbell Barton
2023-12-17 16:43:18 +11:00
parent 1455315111
commit 950334a02c

View File

@@ -115,10 +115,10 @@ static int blf_search_by_mem_name(const char *mem_name)
{
for (int i = 0; i < BLF_MAX_FONT; i++) {
const FontBLF *font = global_font[i];
if (font == nullptr || font->mem_name == nullptr) {
if ((font == nullptr) || (font->mem_name == nullptr)) {
continue;
}
if (font && STREQ(font->mem_name, mem_name)) {
if (STREQ(font->mem_name, mem_name)) {
return i;
}
}
@@ -130,7 +130,10 @@ static int blf_search_by_filepath(const char *filepath)
{
for (int i = 0; i < BLF_MAX_FONT; i++) {
const FontBLF *font = global_font[i];
if (font && font->filepath && (BLI_path_cmp(font->filepath, filepath) == 0)) {
if ((font == nullptr) || (font->filepath == nullptr)) {
continue;
}
if (BLI_path_cmp(font->filepath, filepath) == 0) {
return i;
}
}