diff options
Diffstat (limited to 'scripts/vyatta-qos-util.pl')
-rwxr-xr-x | scripts/vyatta-qos-util.pl | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/scripts/vyatta-qos-util.pl b/scripts/vyatta-qos-util.pl index a19baee..9bb2ea1 100755 --- a/scripts/vyatta-qos-util.pl +++ b/scripts/vyatta-qos-util.pl @@ -24,13 +24,8 @@ use Vyatta::Qos::Util qw( getPercent getRate getBurstSize getProtocol use Getopt::Long; sub getPercentOrRate { - my $percent = shift; - if ( $percent =~ /%$/ ) { - return getPercent($percent); - } - else { - return getRate($percent); - } + my $rate = shift; + return ( $rate =~ /%$/ ) ? getPercent($rate) : getRate($rate); } sub usage { @@ -57,4 +52,3 @@ GetOptions( "tos=s" => sub { getDsfield( $_[1] ); }, "time=s" => sub { getTime( $_[1] ); }, ) or usage(); - |