[Rt-commit] rtir branch, 2.6/perlcritic, updated. 2.6.0-34-g9e1d668
Alex Vandiver
alexmv at bestpractical.com
Thu Jul 21 17:28:07 EDT 2011
The branch, 2.6/perlcritic has been updated
via 9e1d6680be562e7b2f7d288b1ef030b7022b1738 (commit)
from 12d932ce5b51a9137adf2e3b18a8ddbe118c9e80 (commit)
Summary of changes:
lib/RT/IR.pm | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
- Log -----------------------------------------------------------------
commit 9e1d6680be562e7b2f7d288b1ef030b7022b1738
Author: Alex Vandiver <alexmv at bestpractical.com>
Date: Thu Jul 21 17:28:01 2011 -0400
Alter some regexes to not use $1 after split /\./, which confuses perlcritic
diff --git a/lib/RT/IR.pm b/lib/RT/IR.pm
index 90b2f3b..f76c11a 100644
--- a/lib/RT/IR.pm
+++ b/lib/RT/IR.pm
@@ -335,8 +335,9 @@ sub ParseIPRange {
$sIP = $eIP = sprintf "%03d.%03d.%03d.%03d", split /\./, $1;
}
elsif ( $arg =~ /^\s*($RE{net}{IPv4})-($RE{net}{IPv4})\s*$/o ) {
- $sIP = sprintf "%03d.%03d.%03d.%03d", split /\./, $1;
- $eIP = sprintf "%03d.%03d.%03d.%03d", split /\./, $2;
+ my ($start, $end) = ($1, $2);
+ $sIP = sprintf "%03d.%03d.%03d.%03d", split /\./, $start;
+ $eIP = sprintf "%03d.%03d.%03d.%03d", split /\./, $end;
}
else {
return ();
@@ -460,9 +461,10 @@ wrap 'RT::ObjectCustomFieldValue::Content',
$$val = sprintf "%d.%d.%d.%d", split /\./, $1;
my $large_content = $obj->__Value('LargeContent');
- return if !$large_content
- || $large_content !~ /^\s*($re_ip_serialized)\s*$/o;
- my $eIP = sprintf "%d.%d.%d.%d", split /\./, $1;
+ return unless $large_content;
+ return unless $large_content =~ /^\s*($re_ip_serialized)\s*$/o;
+ my $eIP = $1;
+ $eIP = sprintf "%d.%d.%d.%d", split /\./, $eIP;
$$val .= '-'. $eIP unless $$val eq $eIP;
return;
};
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list