On Fri, Nov 18, 2022 at 06:14:01PM +0000, José Matos wrote:
> On Fri, 2022-11-18 at 18:43 +0100, Thibaut Cuvelier wrote:
> > You can avoid this level of indentation by defining the variable
> > within the if: 
> > 
> > if (const vector<docstring> potential_terms =
> > getSubentriesAsText(runparams); !potential_terms.empty()) {
> > 
> > I don't really like this syntax, because it makes extremely long
> > lines, but it has strong advantages.
> 
> This helps a bit:
> 
> if (const auto potential_terms = getSubentriesAsText(runparams);
>     !potential_terms.empty()) {...}
> 
> Using const auto and aligning the condition with the opening
> parenthesis.
> 
> FWIW I think that using curly brackets just to define the variable's
> scope is ugly. :-) This is an aesthetic opinion but the issue is also
> just aesthetic. :-D

Makes sense. I will drop the patch :)

Thanks to you and Thibaut for the feedback.

Scott

Attachment: signature.asc
Description: PGP signature

-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel

Reply via email to