Skip to content

Commit

Permalink
Get rid of an unnecessary variable.
Browse files Browse the repository at this point in the history
Just directly pass the return value of prefs_find_module() as the first
argument to prefs_find_preference(); if it's null,
prefs_find_preference() will return a null pointer, so we don't need to
test it first.
  • Loading branch information
guyharris committed Nov 22, 2024
1 parent 9802120 commit b5ca6f3
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions ui/preference_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,13 @@ prefs_main_write(void)
static unsigned int
prefs_store_ext_helper(const char * module_name, const char *pref_name, const char *pref_value)
{
module_t * module = NULL;
pref_t * pref = NULL;
unsigned int pref_changed = 0;

if ( !prefs_is_registered_protocol(module_name))
return 0;

module = prefs_find_module(module_name);
if ( !module )
return 0;

pref = prefs_find_preference(module, pref_name);
pref = prefs_find_preference(prefs_find_module(module_name), pref_name);

if (!pref)
return 0;
Expand Down

0 comments on commit b5ca6f3

Please sign in to comment.