[glib: 2/4] gerror: Drop a redundant condition
- From: Sebastian Dröge <sdroege src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 2/4] gerror: Drop a redundant condition
- Date: Thu, 7 Jan 2021 14:11:28 +0000 (UTC)
commit e233859544cfa4df6fe4b0174e2312f173cdd603
Author: Philip Withnall <pwithnall endlessos org>
Date: Wed Jan 6 17:24:00 2021 +0000
gerror: Drop a redundant condition
At this point, if `dest` is non-`NULL` then we can guarantee
`*dest != NULL` due to `g_propagate_error()` succeeding.
Signed-off-by: Philip Withnall <pwithnall endlessos org>
glib/gerror.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/glib/gerror.c b/glib/gerror.c
index 5199bdd60..18be9edec 100644
--- a/glib/gerror.c
+++ b/glib/gerror.c
@@ -1111,10 +1111,11 @@ g_propagate_prefixed_error (GError **dest,
{
g_propagate_error (dest, src);
- if (dest && *dest)
+ if (dest)
{
va_list ap;
+ g_assert (*dest != NULL);
va_start (ap, format);
g_error_add_prefix (&(*dest)->message, format, ap);
va_end (ap);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]