Restructure the code in copyfuncs and equalfuncs to put much heavier

reliance on macros, in hopes of eliminating silly typos (like copying
to the wrong field) and just generally making it easier to see the forest
instead of the trees.  As an example, here is the new code for A_Indices:

static A_Indices *
_copyAIndices(A_Indices *from)
{
	A_Indices  *newnode = makeNode(A_Indices);

	COPY_NODE_FIELD(lidx);
	COPY_NODE_FIELD(uidx);

	return newnode;
}

static bool
_equalAIndices(A_Indices *a, A_Indices *b)
{
	COMPARE_NODE_FIELD(lidx);
	COMPARE_NODE_FIELD(uidx);

	return true;
}

I plan to redo outfuncs/readfuncs in a similar style, but am committing
what I've got.
WIN32_DEV
Tom Lane 23 years ago
parent 200dd8e3f8
commit 2eafcf68d5
  1. 1845
      src/backend/nodes/copyfuncs.c
  2. 1590
      src/backend/nodes/equalfuncs.c

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save