chiark / gitweb /
sd-bus: drop redundant code
authorDavid Herrmann <dh.herrmann@gmail.com>
Tue, 28 Jul 2015 16:13:33 +0000 (18:13 +0200)
committerSven Eden <yamakuzure@gmx.net>
Tue, 14 Mar 2017 09:07:19 +0000 (10:07 +0100)
If c->item_size is 0, the next item to parse in a structure is empty.
However, this also implies that the signature must be empty. The latter
case is already handled just fine by enter_struct_or_dict_entry() so
there is no reason to handle the same case in the caller.

src/libelogind/sd-bus/bus-message.c

index 081f39d83b0d89844462dccff86cbf6cac156e13..c8806d516ada152ecc5f0e9223b03bd21d887b6d 100644 (file)
@@ -3954,12 +3954,6 @@ static int enter_struct_or_dict_entry(
                 if (r < 0)
                         return r;
 
-        } else if (c->item_size <= 0) {
-
-                /* gvariant empty struct */
-                *item_size = 0;
-                *offsets = NULL;
-                *n_offsets = 0;
         } else
                 /* gvariant with contents */
                 return build_struct_offsets(m, contents, c->item_size, item_size, offsets, n_offsets);