mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-12-09 18:13:41 +01:00
gdataset: refactor check for old value in g_datalist_id_replace_data()
GData does not support to track NULL values. That means, the existing value is NULL if-and-only-if the GDataElt is NULL. Thus the check for `if (val == NULL && ...` is already covered by `if (data)` above, and we can move that to the else branch.
This commit is contained in:
@@ -1371,12 +1371,12 @@ g_datalist_id_replace_data (GData **datalist,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (val == NULL && oldval == NULL && newval != NULL)
|
||||
else
|
||||
{
|
||||
if (datalist_append (&d, key_id, newval, destroy))
|
||||
if (oldval == NULL && newval != NULL)
|
||||
{
|
||||
set_d = TRUE;
|
||||
if (datalist_append (&d, key_id, newval, destroy))
|
||||
set_d = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user