Skip to content

Commit 16494db

Browse files
committed
df/table: Only compute total row if the user requested for it
It adds extra (tiny, but still...) computation for no reason
1 parent a4d596d commit 16494db

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/uu/df/src/table.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,9 @@ impl Table {
488488
let row = Row::from_filesystem(filesystem, &options.block_size);
489489
let fmt = RowFormatter::new(&row, options, false);
490490
let values = fmt.get_cells();
491-
total += row;
491+
if options.show_total {
492+
total += row;
493+
}
492494

493495
rows.push(values);
494496
}

0 commit comments

Comments
 (0)