mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
ls: remove redundant HashMap lookup in append_raw_style_code_for_indicator
This commit is contained in:
@@ -129,14 +129,11 @@ impl<'a> StyleManager<'a> {
|
||||
indicator: Indicator,
|
||||
style_code: &mut String,
|
||||
) {
|
||||
if !self.indicator_codes.contains_key(&indicator) {
|
||||
return;
|
||||
}
|
||||
style_code.push_str(self.reset(!self.initial_reset_is_done));
|
||||
style_code.push_str(ANSI_CSI);
|
||||
if let Some(raw) = self.indicator_codes.get(&indicator) {
|
||||
if let Some(raw) = self.indicator_codes.get(&indicator).cloned() {
|
||||
debug_assert!(!raw.is_empty());
|
||||
style_code.push_str(raw);
|
||||
style_code.push_str(self.reset(!self.initial_reset_is_done));
|
||||
style_code.push_str(ANSI_CSI);
|
||||
style_code.push_str(&raw);
|
||||
style_code.push_str(ANSI_SGR_END);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user