tests: reduce indentation in test_nwrap_getgrgid() by using early returns.
authorMichael Adam <obnox@samba.org>
Fri, 15 Aug 2014 09:56:11 +0000 (11:56 +0200)
committerMichael Adam <obnox@samba.org>
Fri, 15 Aug 2014 10:39:00 +0000 (12:39 +0200)
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
tests/testsuite.c

index c92bdf50348af3ef5022775d4fae911996078d68..ab8826376e412645a4a73fef98ffcdc9c329c08f 100644 (file)
@@ -350,15 +350,17 @@ static bool test_nwrap_getgrgid(gid_t gid,
        DEBUG("Testing getgrgid: %lu\n", (unsigned long)gid);
 
        grp = getgrgid(gid);
-       if (grp != NULL) {
-               print_group(grp);
+       if (grp == NULL) {
+               return false;
+       }
 
-               if (grp_p != NULL) {
-                       copy_group(grp, grp_p);
-               }
+       print_group(grp);
+
+       if (grp_p != NULL) {
+               copy_group(grp, grp_p);
        }
 
-       return grp != NULL ? true : false;
+       return true;
 }
 
 static bool test_nwrap_getgrgid_r(gid_t gid,