Sorting case branches in outfuncs.c/outNode alphabetically - Mailing list pgsql-hackers

From Fedir Panasenko
Subject Sorting case branches in outfuncs.c/outNode alphabetically
Date
Msg-id CAGPGFPSsUFgn-EyA3NZba4WHppPyfR6WTcJWnyL4jSm9j4RnWQ@mail.gmail.com
Whole thread Raw
Responses Re: Sorting case branches in outfuncs.c/outNode alphabetically
List pgsql-hackers
Hi all,

outfuncs.c contains a switch statement responsible for choosing
serialization function per node type here:
https://github.com/postgres/postgres/blob/master/src/backend/nodes/outfuncs.c#L3711
It spans over >650LOC and is quite unreadable, requiring using search
or code analysis tools for pretty much anything.

I'd like to sort these case branches alphabetically and I'd like to
get some input on that prior to submitting a patch. Obvious benefit
would be increase in readability, with the downside of somewhat
messing up the git history.

(readfuncs.c contains a similar construct for deserializing nodes, but
that one is if...else based as opposed to switch, so order there might
have performance implications -> I'd reserve that topic for separate
discussion).

---
Best regards,
Fedir



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: SELECT INTO deprecation
Next
From: Alastair Turner
Date:
Subject: Re: Proposed patch for key managment