mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-27 20:52:12 +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;
|
GHashTableIter iter;
|
||||||
gpointer key, value;
|
gpointer key, value;
|
||||||
|
|
||||||
|
g_assert (search_token != NULL);
|
||||||
|
|
||||||
if (!dir->memory_index)
|
if (!dir->memory_index)
|
||||||
desktop_file_dir_unindexed_setup_search (dir);
|
desktop_file_dir_unindexed_setup_search (dir);
|
||||||
|
|
||||||
@ -1270,7 +1272,7 @@ desktop_file_dir_unindexed_search (DesktopFileDir *dir,
|
|||||||
p = strstr (key, search_token);
|
p = strstr (key, search_token);
|
||||||
if (p == NULL)
|
if (p == NULL)
|
||||||
continue;
|
continue;
|
||||||
else if (p == key && search_token != NULL && *search_token != '\0')
|
else if (p == key && *search_token != '\0')
|
||||||
match_type = MATCH_TYPE_PREFIX;
|
match_type = MATCH_TYPE_PREFIX;
|
||||||
else
|
else
|
||||||
match_type = MATCH_TYPE_SUBSTRING;
|
match_type = MATCH_TYPE_SUBSTRING;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user