[glib] gkeyfile: Remove dead code and unused string literals
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] gkeyfile: Remove dead code and unused string literals
- Date: Sat, 3 Oct 2015 22:32:03 +0000 (UTC)
commit 58ec6674801f07edcf79ba7e6a4a9f17d1a1e13b
Author: Philip Withnall <philip withnall collabora co uk>
Date: Sat Oct 3 23:30:14 2015 +0100
gkeyfile: Remove dead code and unused string literals
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 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/glib/gkeyfile.c b/glib/gkeyfile.c
index e168f56..2756d67 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;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]