Skip to content

Commit

Permalink
Coding style
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelTimbert committed May 31, 2024
1 parent 0afe50e commit 211e81c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/Zonemaster/Engine/Nameserver.pm
Original file line number Diff line number Diff line change
Expand Up @@ -574,16 +574,16 @@ sub save {

my $old = POSIX::setlocale( POSIX::LC_ALL, 'C' );
my $json = JSON::PP->new->allow_blessed->convert_blessed;
$json = $json->canonical(1);
$json = $json->canonical( 1 );

open my $fh, '>', $filename or die "Cache save failed: $!";
foreach my $name ( sort keys %object_cache ) {
foreach my $addr ( sort keys %{ $object_cache{$name} } ) {

# set ID field of packets to 0
my %data = %{$object_cache{$name}{$addr}->cache->data};
foreach my $key ( keys %data){
$data{$key}->packet->id(0) if defined($data{$key});
my %data = %{ $object_cache{$name}{$addr}->cache->data };
foreach my $key ( keys %data ){
$data{$key}->packet->id( 0 ) if defined( $data{$key} );
}

say $fh "$name $addr " . $json->encode( $object_cache{$name}{$addr}->cache->data );
Expand Down

0 comments on commit 211e81c

Please sign in to comment.