diff options
author | Philip Withnall <pwithnall@endlessos.org> | 2021-03-14 16:57:33 +0000 |
---|---|---|
committer | Philip Withnall <pwithnall@endlessos.org> | 2021-11-02 09:38:36 +0000 |
commit | 655e2bac33104e66894e93d9aa6de7a81576ae6c (patch) | |
tree | 98aab48dec7054bc016a317ac2a5724f2876f1b5 /glib/gkeyfile.c | |
parent | f471afb646dbb141b5ab5231fce795d4fbaa30bc (diff) | |
download | glib-655e2bac33104e66894e93d9aa6de7a81576ae6c.tar.gz |
gkeyfile: Remove some redundant checks
`g_key_file_parse_key_value_pair()` checks that both of these are
non-NULL on entry, and they can’t be modified between then and here.
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
Diffstat (limited to 'glib/gkeyfile.c')
-rw-r--r-- | glib/gkeyfile.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/glib/gkeyfile.c b/glib/gkeyfile.c index 0f8d18e44..17494d4a9 100644 --- a/glib/gkeyfile.c +++ b/glib/gkeyfile.c @@ -1406,9 +1406,11 @@ g_key_file_parse_key_value_pair (GKeyFile *key_file, g_warn_if_fail (key_file->start_group != NULL); - if (key_file->current_group - && key_file->current_group->name - && key_file->start_group == key_file->current_group + /* Checked on entry to this function */ + g_assert (key_file->current_group != NULL); + g_assert (key_file->current_group->name != NULL); + + if (key_file->start_group == key_file->current_group && strcmp (key, "Encoding") == 0) { if (value_len != strlen ("UTF-8") || |