From 58ec6674801f07edcf79ba7e6a4a9f17d1a1e13b Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Sat, 3 Oct 2015 23:30:14 +0100 Subject: [PATCH] gkeyfile: Remove dead code and unused string literals MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In all these functions, group_name is guaranteed to be non-NULL by the function preconditions, so there is no need to handle it as NULL when building error messages. Remove some unnecessary string literals as a result. Coverity CID: 1325438–1325441 --- glib/gkeyfile.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/glib/gkeyfile.c b/glib/gkeyfile.c index e168f56c8..2756d671b 100644 --- a/glib/gkeyfile.c +++ b/glib/gkeyfile.c @@ -1546,7 +1546,7 @@ g_key_file_get_keys (GKeyFile *key_file, g_set_error (error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_GROUP_NOT_FOUND, _("Key file does not have group '%s'"), - group_name ? group_name : "(null)"); + group_name); return NULL; } @@ -1719,7 +1719,7 @@ g_key_file_get_value (GKeyFile *key_file, g_set_error (error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_GROUP_NOT_FOUND, _("Key file does not have group '%s'"), - group_name ? group_name : "(null)"); + group_name); return NULL; } @@ -3564,7 +3564,7 @@ g_key_file_has_key_full (GKeyFile *key_file, g_set_error (error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_GROUP_NOT_FOUND, _("Key file does not have group '%s'"), - group_name ? group_name : "(null)"); + group_name); return FALSE; } @@ -3860,7 +3860,7 @@ g_key_file_remove_key (GKeyFile *key_file, g_set_error (error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_GROUP_NOT_FOUND, _("Key file does not have group '%s'"), - group_name ? group_name : "(null)"); + group_name); return FALSE; }