From eb15e0ef31edcdff2ad72a39ecdcb706bd400e94 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Fri, 8 Jul 2016 05:43:56 +0200 Subject: (initialize) simplify --- perl-install/partition_table/gpt.pm | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/perl-install/partition_table/gpt.pm b/perl-install/partition_table/gpt.pm index 5ef358e82..c5af99275 100644 --- a/perl-install/partition_table/gpt.pm +++ b/perl-install/partition_table/gpt.pm @@ -113,11 +113,8 @@ sub write { sub initialize { my ($class, $hd) = @_; - my @raw; - for (my $part_number = 0; $part_number < $nb_primary-1; $part_number++) { - # part_number starts at 1 - $raw[$part_number] = { part_number => $part_number + 1 }; - } + # part_number starts at 1 + my @raw = map { +{ part_number => $_ + 1 } } 0..$nb_primary-2; $hd->{primary} = { raw => \@raw }; bless $hd, $class; } -- cgit v1.2.1