minor 'list' optimization
This commit is contained in:
parent
8e2826b110
commit
ff30bc1052
1 changed files with 2 additions and 1 deletions
|
@ -127,6 +127,7 @@ pub fn list(state: &mut State) {
|
||||||
let sessions = util::get_sessions().unwrap_or(Vec::new());
|
let sessions = util::get_sessions().unwrap_or(Vec::new());
|
||||||
|
|
||||||
let search = state.target();
|
let search = state.target();
|
||||||
|
let previous = message(MSG_PREVIOUS);
|
||||||
|
|
||||||
// handle empty case
|
// handle empty case
|
||||||
if sessions.len() == 0 {
|
if sessions.len() == 0 {
|
||||||
|
@ -154,7 +155,7 @@ pub fn list(state: &mut State) {
|
||||||
let compare = Some(name.clone());
|
let compare = Some(name.clone());
|
||||||
let marker =
|
let marker =
|
||||||
if compare == state.title { current_symbol.clone() }
|
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() };
|
else { " ".to_string() };
|
||||||
|
|
||||||
println!(
|
println!(
|
||||||
|
|
Loading…
Reference in a new issue