mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-17 18:02:09 +03:00
df: tune slightly
* src/df.c (get_header, get_dev): Avoid calling mbswidth twice when once will do.
This commit is contained in:
1 parent
1ecf7abe4a
commit
25c74a37ca
1 file changed
+4
-2
@@ -595,7 +595,8 @@ get_header (void)
|
||||
|
||||
table[nrows - 1][col] = cell;
|
||||
|
||||
columns[col]->width = MAX (columns[col]->width, mbswidth (cell, 0));
|
||||
size_t cell_width = mbswidth (cell, 0);
|
||||
columns[col]->width = MAX (columns[col]->width, cell_width);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1205,7 +1206,8 @@ get_dev (char const *disk, char const *mount_point, char const* file,
|
||||
assert (!"empty cell");
|
||||
|
||||
hide_problematic_chars (cell);
|
||||
columns[col]->width = MAX (columns[col]->width, mbswidth (cell, 0));
|
||||
size_t cell_width = mbswidth (cell, 0);
|
||||
columns[col]->width = MAX (columns[col]->width, cell_width);
|
||||
table[nrows - 1][col] = cell;
|
||||
}
|
||||
free (dev_name);
|
||||
|
||||
Reference in new issue
Block a user