Improve two comments related to a boolean DefElem's value
authorMichael Paquier <[email protected]>
Mon, 11 Jul 2022 02:07:33 +0000 (11:07 +0900)
committerMichael Paquier <[email protected]>
Mon, 11 Jul 2022 02:07:33 +0000 (11:07 +0900)
The original comments mentioned a "parameter" as something not defined
in a fast-exit path to assume a true status.  This is rather confusing
as the parameter DefElem is defined, and the intention is to check if
its value is defined.  This improves both comments to mention the value
assigned to the DefElem's value instead, so as future patches are able
to catch the tweak if this code pattern gets copied around more.

Author: Peter Smith
Discussion: https://postgr.es/m/CAHut+Pv0yWynWTmp4o34s0d98xVubys9fy=p0YXsZ5_sUcNnMw@mail.gmail.com

src/backend/commands/copy.c
src/backend/commands/define.c

index e2870e3c11cda79651e6aeca625d433f3eac9a85..3ac731803bd41533ad05b9434d2ee14339bbc787 100644 (file)
@@ -321,7 +321,7 @@ static CopyHeaderChoice
 defGetCopyHeaderChoice(DefElem *def, bool is_from)
 {
    /*
-    * If no parameter given, assume "true" is meant.
+    * If no parameter value given, assume "true" is meant.
     */
    if (def->arg == NULL)
        return COPY_HEADER_TRUE;
index 0755ab1eae539cb27a737a1617ae3282620de6e5..86b89071eeddfe51df180db6a63dfa1bb8126c97 100644 (file)
@@ -108,7 +108,7 @@ bool
 defGetBoolean(DefElem *def)
 {
    /*
-    * If no parameter given, assume "true" is meant.
+    * If no parameter value given, assume "true" is meant.
     */
    if (def->arg == NULL)
        return true;