On Wed, Nov 23, 2022 at 7:41 PM Andres Freund <andres@xxxxxxxxxxx> wrote:
Hi,
On 2022-11-23 18:11:22 -0500, Tom Lane wrote:
> Andres Freund <andres@xxxxxxxxxxx> writes:
> > On 2022-11-21 10:58:06 -0500, Tom Lane wrote:
> >> It'd certainly be nice if we could use Readline on Windows.
So It might just be that we need to split up that very long "else if" chain in
psql_completion().
Andres Freund
That's exactly what I did:
int if_continues = 0; // declared at the top
Circa Line 3,900
else
if_continues = 1; // break huge if
if (if_continues == 0)
NULL;
if_continues = 1; // break huge if
if (if_continues == 0)
NULL;
else ... // This else picks up here again
and you could replace the NULL with if_continues = 0; to allow breaking it again in the future with the same variable.
I've never seen a single statement that long...
Regards Kirk