Skip to content

Commit d7b55c5

Browse files
3v1n0mattsu2020
authored andcommitted
df/table: Only compute total row if the user requested for it
It adds extra (tiny, but still...) computation for no reason
1 parent e2e8055 commit d7b55c5

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
@@ -493,7 +493,9 @@ impl Table {
493493
let row = Row::from_filesystem(filesystem, &options.block_size);
494494
let fmt = RowFormatter::new(&row, options, false);
495495
let values = fmt.get_cells();
496-
total += row;
496+
if options.show_total {
497+
total += row;
498+
}
497499

498500
rows.push(values);
499501
}

0 commit comments

Comments
 (0)