On 12/13/2013 10:10 AM, Max Reitz wrote:
> Reversing qdict_array_split(), qdict_flatten() should flatten QLists as
> well by interpreting them as QDicts where every entry's key is its
> index.
> 
> This allows bringing QDicts with QLists from QMP commands to the same
> form as they would be given as command-line options, thereby allowing
> them to be parsed the same way.
> 
> Signed-off-by: Max Reitz <mre...@redhat.com>
> ---
>  qobject/qdict.c | 58 
> +++++++++++++++++++++++++++++++++++++++++++++++++++------

> +    /* This function is never called with prefix == NULL, i.e., it is always
> +     * called from within qdict_flatten_q(list|dict)(). Therefore, it does 
> not
> +     * need to remove list entries during the iteration (the whole list will 
> be
> +     * deleted eventually anyway from qdict_flatten_qdict()). Also, prefix 
> can
> +     * never be NULL. */

The comment sounds redundant: "never called with prefix == NULL ...
prefix can never be NULL".

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to