Skip to content

Commit 0663e89

Browse files
committed
genblock: move chomp up, each in scalar context
1 parent 7d2eb25 commit 0663e89

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

genblock

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ sub reduce_domains {
114114
my $hashref = shift or return;
115115
my $redundant_domains_hashref;
116116

117-
while ( my ( $domain, undef ) = each %$hashref ) {
117+
while ( my $domain = each %$hashref ) {
118118
my @domain_leaves = reverse( split /\./, $domain );
119119
my $index = 1;
120120

@@ -139,7 +139,9 @@ sub unique_domains {
139139
my %unique_domains;
140140

141141
PROCESS_LINE: while ( <<>> ) {
142-
## Don't process commented or blank lines.
142+
chomp;
143+
144+
# Don't process commented or blank lines.
143145
next if /\A \s*? \#/aaxx;
144146
next if /\A \s* \z/aaxx;
145147
@@ -164,7 +166,6 @@ PROCESS_LINE: while ( <<>> ) {
164166
165167
# Lowercase vs uppercase doesn't matter for DNS.
166168
$_ = lc $_;
167-
chomp;
168169
169170
my $domain = do {
170171
is_domain $_ or next PROCESS_LINE;

0 commit comments

Comments
 (0)