mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 03:16:17 +01:00
gdesktopappinfo: Drop an unnecessary NULL check
`search_token` cannot be `NULL` at this point (guaranteed by all the current call sites of `desktop_file_dir_unindexed_search()`), so remove an unnecessary `NULL` check. Add an assertion to make the nullability clear. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Coverity CID: #1502196, #1502193
This commit is contained in:
parent
0c640cf671
commit
8463155b21
@ -1253,6 +1253,8 @@ desktop_file_dir_unindexed_search (DesktopFileDir *dir,
|
||||
GHashTableIter iter;
|
||||
gpointer key, value;
|
||||
|
||||
g_assert (search_token != NULL);
|
||||
|
||||
if (!dir->memory_index)
|
||||
desktop_file_dir_unindexed_setup_search (dir);
|
||||
|
||||
@ -1270,7 +1272,7 @@ desktop_file_dir_unindexed_search (DesktopFileDir *dir,
|
||||
p = strstr (key, search_token);
|
||||
if (p == NULL)
|
||||
continue;
|
||||
else if (p == key && search_token != NULL && *search_token != '\0')
|
||||
else if (p == key && *search_token != '\0')
|
||||
match_type = MATCH_TYPE_PREFIX;
|
||||
else
|
||||
match_type = MATCH_TYPE_SUBSTRING;
|
||||
|
Loading…
Reference in New Issue
Block a user