minor 'list' optimization

This commit is contained in:
Valerie Wolfe 2024-07-22 10:18:35 -04:00
parent 8e2826b110
commit ff30bc1052

View file

@ -127,6 +127,7 @@ pub fn list(state: &mut State) {
let sessions = util::get_sessions().unwrap_or(Vec::new());
let search = state.target();
let previous = message(MSG_PREVIOUS);
// handle empty case
if sessions.len() == 0 {
@ -154,7 +155,7 @@ pub fn list(state: &mut State) {
let compare = Some(name.clone());
let marker =
if compare == state.title { current_symbol.clone() }
else if compare == message(MSG_PREVIOUS) { prev_symbol.clone() }
else if state.session && compare == previous { prev_symbol.clone() }
else { " ".to_string() };
println!(