summaryrefslogtreecommitdiffstats
path: root/dhcp_wizard
diff options
context:
space:
mode:
Diffstat (limited to 'dhcp_wizard')
-rwxr-xr-xdhcp_wizard/Dhcp.pm18
1 files changed, 2 insertions, 16 deletions
diff --git a/dhcp_wizard/Dhcp.pm b/dhcp_wizard/Dhcp.pm
index 055dd055..04de9634 100755
--- a/dhcp_wizard/Dhcp.pm
+++ b/dhcp_wizard/Dhcp.pm
@@ -141,27 +141,13 @@ $o->{pages} = {
sub compute_range {
my ($d, $s) = @_;
- my $n;
- if ($d <= 64) {
- $n = "65";
- } elsif ($d <= 128) {
- $n = "129";
- } else {
- $n = "1";
- }
+ my $n = $d <= 64 ? "65" : $d <= 128 ? "129" : "1";
"$s.$n";
}
sub compute_range2 {
my ($d, $s) = @_;
- my $n;
- if ($d <= 128) {
- $n = "254";
- } elsif ($d > 192) {
- $n = "192";
- } else {
- $n = "128";
- }
+ my $n = $d <= 128 ? "254" : $d > 192 ? "192" : "128";
"$s.$n";
}