mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-01 23:13:40 +02:00
gdataset: add assertions that we never add a zero key
All public API already ensures that this cannot ever happen. The assertion is only for the reviewer and ease of mind.
This commit is contained in:
@@ -301,6 +301,10 @@ datalist_append (GData **data, GQuark key_id, gpointer new_data, GDestroyNotify
|
||||
gboolean reallocated;
|
||||
GData *d;
|
||||
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
g_assert (key_id != 0);
|
||||
#endif
|
||||
|
||||
d = *data;
|
||||
if (!d)
|
||||
{
|
||||
@@ -613,6 +617,10 @@ g_data_set_internal (GData **datalist,
|
||||
GDataElt old, *data;
|
||||
guint32 idx;
|
||||
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
g_assert (key_id != 0);
|
||||
#endif
|
||||
|
||||
d = g_datalist_lock_and_get (datalist);
|
||||
|
||||
data = datalist_find (d, key_id, &idx);
|
||||
|
Reference in New Issue
Block a user