Commit dc3e62d5 authored by Nigel Kukard's avatar Nigel Kukard
Browse files

Use return instead of return undef

parent 82138ff7
......@@ -654,10 +654,10 @@ sub getKbit
my ($counter,$quantifier) = @_;
# If there is no counter
return undef if (!defined($counter));
return if (!defined($counter));
# We need a quantifier
return undef if (!defined($quantifier));
return if (!defined($quantifier));
# Initialize counter
my $newCounter = $counter;
......@@ -667,7 +667,7 @@ sub getKbit
} elsif ($quantifier =~ /^k$/i) {
$newCounter = $counter * 1;
} else {
return undef;
return;
}
return $newCounter;
......
......@@ -805,7 +805,7 @@ sub getSIDFromCID
# Grab identifier based on class ID
my $identifier = _getIdentifierFromCID($iface,$cid);
if (!defined($identifier)) {
return undef;
return;
}
# Return the SID fo the identifier
......@@ -826,7 +826,7 @@ sub setSIDFromCID
# If not, grab the identifier
my $identifier = _getIdentifierFromCID($iface,$cid);
if (!defined($identifier)) {
return undef;
return;
}
# And setup a new SID
$sid = _setSIDFromIdentifier($identifier);
......@@ -846,7 +846,7 @@ sub getSIDFromPID
# Grab identifier from a PID
my $identifier = _getIdentifierFromPID($pid);
if (!defined($identifier)) {
return undef;
return;
}
# Return the SID for the PID
......@@ -866,7 +866,7 @@ sub setSIDFromPID
# If we can't, grab the identifier instead
my $identifier = _getIdentifierFromPID($pid);
if (!defined($identifier)) {
return undef;
return;
}
# And setup the SID
$sid = _setSIDFromIdentifier($identifier);
......@@ -886,7 +886,7 @@ sub getSIDFromCounter
# Grab identifier from a counter
my $identifier = _getIdentifierFromCounter($counter);
if (!defined($identifier)) {
return undef;
return;
}
# Return the SID for the counter
......@@ -907,7 +907,7 @@ sub setSIDFromCounter
# If we can't, grab the identifier instead
my $identifier = _getIdentifierFromCounter($counter);
if (!defined($identifier)) {
return undef;
return;
}
# And setup the SID
$sid = _setSIDFromIdentifier($identifier);
......@@ -935,7 +935,7 @@ sub getTrafficDirection
return STATISTICS_DIR_RX;
}
return undef;
return;
}
......@@ -1097,7 +1097,7 @@ sub _getIdentifierFromPID
my $pool = getPool($pid);
if (!defined($pool)) {
return undef;
return;
}
return sprintf("Pool:%s/%s",$pool->{'InterfaceGroupID'},$pool->{'Name'});
......@@ -1139,7 +1139,7 @@ sub _getSIDFromIdentifier
# We need the DB to be alive to do this...
if (!defined($globals->{'Database'})) {
return undef;
return;
}
# Try grab it from DB
......@@ -1154,7 +1154,7 @@ sub _getSIDFromIdentifier
$logger->log(LOG_ERR,"[STATISTICS] Failed to get SID from identifier '%s': %s",$identifier,awitpt::db::dblayer::Error());
}
return undef;
return;
}
......@@ -1167,7 +1167,7 @@ sub _setSIDFromIdentifier
# We need the DB to be alive to do this...
if (!defined($globals->{'Database'})) {
return undef;
return;
}
# Try add it to the DB
......@@ -1177,7 +1177,7 @@ sub _setSIDFromIdentifier
$logger->log(LOG_ERR,"[STATISTICS] Failed to set SID from identifier '%s': %s",$identifier,awitpt::db::dblayer::Error());
}
return undef;
return;
}
......
......@@ -826,7 +826,7 @@ sub getPIDFromTcClass
# Return the pool ID if found
my $ref = __getRefByMinorTcClass($interfaceID,$majorTcClass,$minorTcClass);
if (!defined($ref) || substr($ref,0,13) ne "_pool_class_:") {
return undef;
return;
}
return substr($ref,13);
......@@ -842,7 +842,7 @@ sub isPoolTcClass
my $pid = getPIDFromTcClass($interfaceID,$majorTcClass,$minorTcClass);
if (!defined($pid)) {
return undef;
return;
}
return $minorTcClass;
......@@ -861,7 +861,7 @@ sub getCIDFromTcClass
my $ref = __getRefByMinorTcClass($interfaceID,$majorTcClass,$minorTcClass);
# If we're not a traffic class, just return
if (substr($ref,0,16) ne "_traffic_class_:") {
return undef;
return;
}
# Else return the part after the above tag
......@@ -1675,7 +1675,7 @@ sub _disposePrioTcClass
# If we can grab the major class dipose of it
my $majorTcClass = _getPrioTcClass($interfaceID,$tcClass);
if (!defined($majorTcClass)) {
return undef;
return;
}
return __disposeMajorTcClass($interfaceID,$majorTcClass);
......@@ -1760,7 +1760,7 @@ sub __getMinorTcClassByRef
if (!defined($globals->{'TcClasses'}->{$interfaceID}) || !defined($globals->{'TcClasses'}->{$interfaceID}->{$majorTcClass})) {
return undef;
return;
}
return $globals->{'TcClasses'}->{$interfaceID}->{$majorTcClass}->{'Reverse'}->{$ref};
......@@ -1775,7 +1775,7 @@ sub __getMajorTcClassByRef
if (!defined($globals->{'TcClasses'}->{$interfaceID})) {
return undef;
return;
}
return $globals->{'TcClasses'}->{$interfaceID}->{'Reverse'}->{$ref};
......@@ -1790,7 +1790,7 @@ sub __getRefByMinorTcClass
if (!defined($globals->{'TcClasses'}->{$interfaceID}) || !defined($globals->{'TcClasses'}->{$interfaceID}->{$majorTcClass})) {
return undef;
return;
}
return $globals->{'TcClasses'}->{$interfaceID}->{$majorTcClass}->{'Track'}->{$minorTcClass};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment