sort: remove redundant if (#10716)

This commit is contained in:
oech3
2026-02-05 05:35:07 +09:00
committed by GitHub
parent 682d9c5f61
commit c7ad6ff483
+8 -19
View File
@@ -2046,25 +2046,14 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
.unwrap_or_default()
};
let mut mode_flags = ModeFlags::default();
if matches.get_flag(options::modes::HUMAN_NUMERIC) {
mode_flags.human_numeric = true;
}
if matches.get_flag(options::modes::MONTH) {
mode_flags.month = true;
}
if matches.get_flag(options::modes::GENERAL_NUMERIC) {
mode_flags.general_numeric = true;
}
if matches.get_flag(options::modes::NUMERIC) {
mode_flags.numeric = true;
}
if matches.get_flag(options::modes::VERSION) {
mode_flags.version = true;
}
if matches.get_flag(options::modes::RANDOM) {
mode_flags.random = true;
}
let mut mode_flags = ModeFlags {
human_numeric: matches.get_flag(options::modes::HUMAN_NUMERIC),
month: matches.get_flag(options::modes::MONTH),
general_numeric: matches.get_flag(options::modes::GENERAL_NUMERIC),
numeric: matches.get_flag(options::modes::NUMERIC),
version: matches.get_flag(options::modes::VERSION),
random: matches.get_flag(options::modes::RANDOM),
};
if let Some(sort_arg) = matches.get_one::<String>(options::modes::SORT) {
match sort_arg.as_str() {
"human-numeric" => mode_flags.human_numeric = true,