From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36921) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zz81h-0000Ed-NA for qemu-devel@nongnu.org; Wed, 18 Nov 2015 14:04:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zz81b-0005fA-O3 for qemu-devel@nongnu.org; Wed, 18 Nov 2015 14:04:17 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35897) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zz81b-0005ej-JJ for qemu-devel@nongnu.org; Wed, 18 Nov 2015 14:04:11 -0500 From: Markus Armbruster References: <1447836791-369-1-git-send-email-eblake@redhat.com> <1447836791-369-37-git-send-email-eblake@redhat.com> Date: Wed, 18 Nov 2015 20:04:08 +0100 In-Reply-To: <1447836791-369-37-git-send-email-eblake@redhat.com> (Eric Blake's message of "Wed, 18 Nov 2015 01:53:11 -0700") Message-ID: <87d1v7gmdz.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v12 36/36] qapi: Shorter visits of optional fields List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: qemu-devel@nongnu.org, Michael Roth Eric Blake writes: > For less code, reflect the determined boolean value of an optional > visit back to the caller instead of making the caller read the > boolean after the fact. > > The resulting generated code has the following diff: > > |- visit_optional(v, &has_fdset_id, "fdset-id"); > |- if (has_fdset_id) { > |+ if (visit_optional(v, &has_fdset_id, "fdset-id")) { > | visit_type_int(v, &fdset_id, "fdset-id", &err); > | if (err) { > | goto out; > | } > | } > > Signed-off-by: Eric Blake Feels like a wash to me, but I'm willing to take it anyway, in recognition of the massive amount of work you've been doing in this area :)