diff options
| author | Paul Buetow <paul@buetow.org> | 2011-08-05 21:28:05 +0000 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2011-08-05 21:28:05 +0000 |
| commit | a219ccb66aed233348cd544eb451173e5cfafdfa (patch) | |
| tree | 1d9377f7114400b5a0b03cfddf618aabc77b9a81 | |
| parent | 2aaae1feba728e2c6af3be2a27b4569ce4a752dc (diff) | |
Simplified some code
| -rwxr-xr-x | loadbars.pl | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/loadbars.pl b/loadbars.pl index e18b16d..b8b0f8d 100755 --- a/loadbars.pl +++ b/loadbars.pl @@ -257,10 +257,8 @@ sub thr_display_stats () { my $rects = {}; my %prev_stats; my %last_loads; - my %displaytxt = ( - on => $CONF{toggletxt}, - host => $CONF{toggletxthost}, - ); + my $displaytxt = $CONF{toggletxt}; + my $displaytxthost = $CONF{toggletxthost}; my $sigstop = 0; my $redraw_background = 0; @@ -276,10 +274,10 @@ sub thr_display_stats () { # Diverse messages $SIG{USR2} = sub { if ($MSG == MSG_TOGGLE_TXT) { - $displaytxt{on} = $CONF{toggletxt}; + $displaytxt = $CONF{toggletxt}; } elsif ($MSG == MSG_TOGGLE_TXT_HOST) { - $displaytxt{host} = $CONF{toggletxthost}; + $displaytxthost = $CONF{toggletxthost}; } elsif ($MSG == MSG_SET_FACTOR) { $factor = $CONF{factor}; @@ -387,11 +385,11 @@ sub thr_display_stats () { : (YELLOW))))); - if ($displaytxt{on}) { + if ($displaytxt) { my ($y, $space) = (5, 15); my $is_host_summary = exists $is_host_summary{$host}; - if ($displaytxt{host} && not $is_host_summary) { + if ($displaytxthost && not $is_host_summary) { $host =~ /([^\.]*)/; $app->print($x, $y, sprintf '%s:', $1); |
