From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp32.i.mail.ru (smtp32.i.mail.ru [94.100.177.92]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 068A045C304 for ; Fri, 11 Dec 2020 17:32:53 +0300 (MSK) Date: Fri, 11 Dec 2020 14:32:53 +0000 From: Nikita Pettik Message-ID: <20201211143253.GE12730@tarantool.org> References: <5b3a70820a00cdfa26189933a4ae0549a0398c72.1607075291.git.sergepetrenko@tarantool.org> <20201210171702.GC1319@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Subject: Re: [Tarantool-patches] [PATCH v3 1/2] box: speed up tuple_field_map_create List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Serge Petrenko Cc: tarantool-patches@dev.tarantool.org On 11 Dec 09:34, Serge Petrenko wrote: > > 10.12.2020 20:17, Nikita Pettik пишет: > > > I'd rewrite this part as: > > > > diff --git a/src/box/tuple_format.c b/src/box/tuple_format.c > > index 6c9b2a255..d6655256a 100644 > > --- a/src/box/tuple_format.c > > +++ b/src/box/tuple_format.c > > @@ -912,10 +912,12 @@ tuple_field_map_create_plain(struct tuple_format *format, const char *tuple, > > } > > end: > > - return validate ? > > - tuple_format_required_fields_validate(format, required_fields, > > - required_fields_sz) : > > - 0; > > + if (validate) { > > + return tuple_format_required_fields_validate(format, > > + required_fields, > > + required_fields_sz); > > + } > > + return 0; > > } > > > > Up to you. Anyway LGTM > > Hm, what about this? Applied. > > diff --git a/src/box/tuple_format.c b/src/box/tuple_format.c > index 6c9b2a255..5f5e833b4 100644 > --- a/src/box/tuple_format.c > +++ b/src/box/tuple_format.c > @@ -912,10 +912,11 @@ tuple_field_map_create_plain(struct tuple_format > *format, const char *tuple, >         } > >  end: > -       return validate ? > -              tuple_format_required_fields_validate(format, > required_fields, > - required_fields_sz) : > -              0; > +       if (!validate) > +               return 0; > + > +       return tuple_format_required_fields_validate(format, > required_fields, > + required_fields_sz); Fine, thx. >  } > >  /** @sa declaration for details. */ > > > > > > +end: > > > + return validate ? > > > + tuple_format_required_fields_validate(format, required_fields, > > > + required_fields_sz) : > > > + 0; > > > +} > > > + > > -- > Serge Petrenko >