mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-12-11 19:13:02 +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,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
if (val == NULL && oldval == NULL && newval != NULL)
|
|
||||||
{
|
{
|
||||||
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