dataset: Do not increment

Do not increment the `data` pointer when it points to an item that has
not been inspected.

Helps https://gitlab.gnome.org/GNOME/glib/-/issues/2672
This commit is contained in:
Peter Bloomfield 2022-06-22 12:51:07 -04:00
parent ebfbef1acd
commit 8c4598aab3

View File

@ -528,11 +528,8 @@ g_data_remove_internal (GData **datalist,
old[found_keys] = *data; old[found_keys] = *data;
found_keys++; found_keys++;
if (data < data_end) if (data < --data_end)
{ *data = *data_end;
data_end--;
*data = *data_end;
}
d->len--; d->len--;
@ -546,8 +543,10 @@ g_data_remove_internal (GData **datalist,
break; break;
} }
} }
else
data++; {
data++;
}
} }
if (found_keys > 0) if (found_keys > 0)