]> granicus.if.org Git - sysstat/commitdiff
Remove conditions which are always true
authorSebastien GODARD <sysstat@users.noreply.github.com>
Wed, 22 Feb 2023 17:18:41 +0000 (18:18 +0100)
committerSebastien GODARD <sysstat@users.noreply.github.com>
Wed, 22 Feb 2023 17:18:41 +0000 (18:18 +0100)
Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
iostat.c
pr_stats.c

index 4c08d6c518bd84316d1a6524449147e66134bc6a..15bcbbc2b318bc3a64abb8e2f238bf644c9ce678 100644 (file)
--- a/iostat.c
+++ b/iostat.c
@@ -2033,7 +2033,7 @@ void rw_io_stat_loop(long int count, struct tm *rectime)
                                /* SIGINT signal caught => Terminate JSON output properly */
                                count = 0;
                        }
-                       else if (DISPLAY_JSON_OUTPUT(flags) && count && !skip) {
+                       else if (DISPLAY_JSON_OUTPUT(flags) && !skip) { /* count != 0 */
                                printf(",");
                        }
                        skip = 0;
index 665ada16ec40e2df30cdb266b84207df0cbbf2e2..8fe04ec1785fe0400a44256cb68d1c51de51716f 100644 (file)
@@ -2836,8 +2836,11 @@ __print_funct_t stub_print_filesystem_stats(struct activity *a, int prev, int cu
                        }
                }
 
-               if (!DISPLAY_ZERO_OMIT(flags) || dispavg || WANT_SINCE_BOOT(flags) || !found ||
-                   (found && memcmp(sfp, sfc, STATS_FILESYSTEM_SIZE2CMP))) {
+               if (!DISPLAY_ZERO_OMIT(flags) || dispavg
+                                             || WANT_SINCE_BOOT(flags)
+                                             || !found
+                                             /* found is true */
+                                             || memcmp(sfp, sfc, STATS_FILESYSTEM_SIZE2CMP)) {
 
                        printf("%-11s", (dispavg ? _("Summary:") : timestamp[curr]));
                        cprintf_f(unit, FALSE, 2, 9, 0,