Sorting case branches in outfuncs.c/outNode alphabetically

From: Fedir Panasenko <fpanasenko(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Sorting case branches in outfuncs.c/outNode alphabetically
Date: 2020-12-15 22:53:35
Message-ID: CAGPGFPSsUFgn-EyA3NZba4WHppPyfR6WTcJWnyL4jSm9j4RnWQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alastair Turner 2020-12-15 23:13:12 Re: Proposed patch for key managment
Previous Message Bruce Momjian 2020-12-15 22:28:09 Re: Minor documentation error regarding streaming replication protocol