]> granicus.if.org Git - postgresql/commitdiff
Remove null-pointer checks that are not needed.
authorMichael Meskes <meskes@postgresql.org>
Wed, 25 Feb 2015 10:46:15 +0000 (11:46 +0100)
committerMichael Meskes <meskes@postgresql.org>
Wed, 25 Feb 2015 10:50:28 +0000 (11:50 +0100)
If a pointer is guaranteed to carry information there is no need to check
for NULL again. Patch by Michael Paquier.

src/interfaces/ecpg/ecpglib/data.c

index 2d0c1180a3c189effa278f89cb394a039e42d6b5..2dcb9153da543d625efb447539068d7ee36d1fa0 100644 (file)
@@ -575,7 +575,7 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno,
                                        if (nres == NULL)
                                        {
                                                ecpg_log("ecpg_get_data on line %d: RESULT %s; errno %d\n",
-                                                                lineno, pval ? pval : "", errno);
+                                                                lineno, pval, errno);
 
                                                if (INFORMIX_MODE(compat))
                                                {
@@ -634,7 +634,7 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno,
                                        if (ires == NULL)
                                        {
                                                ecpg_log("ecpg_get_data on line %d: RESULT %s; errno %d\n",
-                                                                lineno, pval ? pval : "", errno);
+                                                                lineno, pval, errno);
 
                                                if (INFORMIX_MODE(compat))
                                                {
@@ -688,7 +688,7 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno,
                                        if (errno != 0)
                                        {
                                                ecpg_log("ecpg_get_data on line %d: RESULT %s; errno %d\n",
-                                                                lineno, pval ? pval : "", errno);
+                                                                lineno, pval, errno);
 
                                                if (INFORMIX_MODE(compat))
                                                {
@@ -736,7 +736,7 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno,
                                        if (errno != 0)
                                        {
                                                ecpg_log("ecpg_get_data on line %d: RESULT %s; errno %d\n",
-                                                                lineno, pval ? pval : "", errno);
+                                                                lineno, pval, errno);
 
                                                if (INFORMIX_MODE(compat))
                                                {