Hi,

Junwang Zhao <[email protected]> 于2026年3月10日周二 21:32写道:

> > And I also found another case:
> > Size
> > XLogRecoveryShmemSize(void)
> > {
> >     Size        size;
> >
> >     /* XLogRecoveryCtl */
> >     size = sizeof(XLogRecoveryCtlData);
> >
> >     return size;
> > }
> >
> > The above code does not need to define the local variable size;
> > directly returning sizeof(XLogRecoveryCtlData) seems simpler.
>
> I bet the compiler will optimize it away.

Yeah,  XLogRecoveryShmemSize() may be optimized by the compiler,  I only
want the codes to look more consistent.

>I think it's fine as it is.
Ok.

-- 
Thanks,
Tender Wang


Reply via email to