Marc-André Lureau <marcandre.lur...@gmail.com> writes:

> Hi
> On Fri, Aug 24, 2018 at 1:30 PM Markus Armbruster <arm...@redhat.com> wrote:
>>
>> Marc-André Lureau <marcandre.lur...@gmail.com> writes:
>>
>> > Hi
>> >
>> > On Fri, Aug 24, 2018 at 10:05 AM Markus Armbruster <arm...@redhat.com> 
>> > wrote:
>> >>
>> >> Marc-André Lureau <marcandre.lur...@redhat.com> writes:
[...]
>> >> > @@ -406,6 +406,28 @@ void qdict_del(QDict *qdict, const char *key)
>> >> >      }
>> >> >  }
>> >> >
>> >> > +/**
>> >> > + * qdict_steal(): Steal a 'key:value' pair from the dictionary
>> >>
>> >> "Steal" is cute, but perhaps qdict_get_and_del() would be clearer.
>> >
>> > "steal" is common in glib. I don't mind renaming.
>>
>> Hmm.  I found g_hash_table_steal(), but it's a bit different: it
>> "Removes a key and its associated value from a GHashTable without
>> calling the key and value destroy functions" (that part seems close
>> enough), but returns a bool rather than the value.  Feels like sub-par
>> design to me.  Is this the precedence you have in mind?
>
> They are many more _steal* functions in the GNOME libraries (search
> with devhelp): the general idea is to remove an object from the owner
> (without destrying), and return that object/reference.

Alright, I don't mind calling it "steal".

Reply via email to