[balsa] address-books: Drop redundant NULL checks



commit 9a1df358d80868cb5db96f2f967f780e2a36a820
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Tue Jun 4 12:17:34 2019 -0400

    address-books: Drop redundant NULL checks

 libbalsa/address-book-gpe.c  | 4 +---
 libbalsa/address-book-ldap.c | 4 +---
 2 files changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/libbalsa/address-book-gpe.c b/libbalsa/address-book-gpe.c
index 637770ffd..25ea22ef7 100644
--- a/libbalsa/address-book-gpe.c
+++ b/libbalsa/address-book-gpe.c
@@ -269,9 +269,7 @@ gpe_read_attr(void *arg, int argc, char **argv, char **names)
 static gchar *
 create_name(const gchar * first, const gchar * last)
 {
-    if ((first == NULL) && (last == NULL))
-       return NULL;
-    else if (first == NULL)
+    if (first == NULL) /* or if both are NULL */
        return g_strdup(last);
     else if (last == NULL)
        return g_strdup(first);
diff --git a/libbalsa/address-book-ldap.c b/libbalsa/address-book-ldap.c
index 219d88d1b..f834395be 100644
--- a/libbalsa/address-book-ldap.c
+++ b/libbalsa/address-book-ldap.c
@@ -564,9 +564,7 @@ lbabl_get_internet_address(GList *addrs, LDAP *dir, LDAPMessage * e)
 static gchar *
 create_name(gchar * first, gchar * last)
 {
-    if ((first == NULL) && (last == NULL))
-       return NULL;
-    else if (first == NULL)
+    if (first == NULL) /* or if both are NULL */
        return g_strdup(last);
     else if (last == NULL)
        return g_strdup(first);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]