Skip to content

Commit 646cc55

Browse files
committed
Incorporate review comments
1 parent 171d8c5 commit 646cc55

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

lib/Zonemaster/CLI.pm

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ package Zonemaster::CLI;
99

1010
use v5.26;
1111

12-
use strict;
1312
use warnings;
1413

1514
use version; our $VERSION = version->declare( "v7.2.0" );
@@ -646,17 +645,16 @@ sub run {
646645
my %all_nss = %{ Zonemaster::Engine::Nameserver::object_cache };
647646
my @child_nss = @{ $zone->ns };
648647
my @parent_nss = @{ $zone->parent->ns };
649-
my @nss;
648+
my @all_responded_nss;
650649

651650
foreach my $ns_name ( keys %all_nss ) {
652651
foreach my $ns ( values %{ $all_nss{$ns_name} } ) {
653-
push @nss, $ns if scalar @{ $ns->times } > 0;
652+
push @all_responded_nss, $ns if scalar @{ $ns->times } > 0;
654653
}
655654
}
656655

657-
my %nss_filter;
658-
@nss_filter{ ( @child_nss, @parent_nss ) } = undef;
659-
my @other_nss = grep { ! exists $nss_filter{$_} } @nss;
656+
my %nss_filter = map { $_ => undef } ( @child_nss, @parent_nss );
657+
my @other_nss = grep { ! exists $nss_filter{$_} } @all_responded_nss;
660658

661659
if ( $opt_json ) {
662660
my @times;
@@ -690,7 +688,7 @@ sub run {
690688
}
691689
else {
692690
my $header = __( 'Name servers' );
693-
my $max = max map { length( "$_" ) } ( ( @child_nss, @parent_nss, @nss ), $header );
691+
my $max = max map { length( "$_" ) } ( ( @child_nss, @parent_nss, @all_responded_nss ), $header );
694692
printf "\n%${max}s %s\n", $header, ' Max Min Avg Stddev Median Total Count';
695693
printf "%${max}s %s\n", '=' x $max, ' ========== ========== ========== ========== ========== =========== ===========';
696694

0 commit comments

Comments
 (0)