mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-27 14:36:16 +01:00
gdataset: add code comment to g_datalist_get_data()
It's not obvious why we wouldn't use g_quark_try_string(). Add a code comment that this is intentional and a reference for how to find out more. Also, fix typo in another code comment.
This commit is contained in:
parent
bcc22d48b0
commit
10d4351ec9
@ -211,7 +211,7 @@ datalist_remove (GData *data, guint32 idx)
|
|||||||
|
|
||||||
/* g_data_remove_internal() relies on the fact, that this function removes
|
/* g_data_remove_internal() relies on the fact, that this function removes
|
||||||
* the entry similar to g_array_remove_index_fast(). That is, the entries up
|
* the entry similar to g_array_remove_index_fast(). That is, the entries up
|
||||||
* to @idx are left unchanged, and the last entry at moved to position @idx.
|
* to @idx are left unchanged, and the last entry is moved to position @idx.
|
||||||
* */
|
* */
|
||||||
|
|
||||||
data->len--;
|
data->len--;
|
||||||
@ -1244,6 +1244,12 @@ g_datalist_get_data (GData **datalist,
|
|||||||
data_end = data + d->len;
|
data_end = data + d->len;
|
||||||
while (data < data_end)
|
while (data < data_end)
|
||||||
{
|
{
|
||||||
|
/* Here we intentionally compare by strings, instead of calling
|
||||||
|
* g_quark_try_string() first.
|
||||||
|
*
|
||||||
|
* See commit 1cceda49b60b ('Make g_datalist_get_data not look up the
|
||||||
|
* quark').
|
||||||
|
*/
|
||||||
if (g_strcmp0 (g_quark_to_string (data->key), key) == 0)
|
if (g_strcmp0 (g_quark_to_string (data->key), key) == 0)
|
||||||
{
|
{
|
||||||
res = data->data;
|
res = data->data;
|
||||||
|
Loading…
Reference in New Issue
Block a user