From ebf02b59da8d58744166071a18f253c9a0d34e25 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Thu, 22 Jul 2004 02:40:13 +0000 Subject: shorter and faster --- perl-install/fsedit.pm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'perl-install') diff --git a/perl-install/fsedit.pm b/perl-install/fsedit.pm index ce5c0cdee..0c5d8fe4b 100644 --- a/perl-install/fsedit.pm +++ b/perl-install/fsedit.pm @@ -221,17 +221,19 @@ sub hds { foreach partition_table::get_normal_parts($hd); } + my @parts = partition_table::get_normal_parts($hd); + # special case for Various type - $_->{pt_type} = typeOfPart($_->{device}) || 0x100 foreach grep { $_->{pt_type} == 0x100 } partition_table::get_normal_parts($hd); + $_->{pt_type} = typeOfPart($_->{device}) || 0x100 foreach grep { $_->{pt_type} == 0x100 } @parts; #- special case for type overloading (eg: reiserfs is 0x183) - foreach (grep { isExt2($_) || $_->{pt_type} == 0x7 || $_->{pt_type} == 0x17 } partition_table::get_normal_parts($hd)) { + foreach (grep { isExt2($_) || $_->{pt_type} == 0x7 || $_->{pt_type} == 0x17 } @parts) { my $wanted_pt_type = $_->{pt_type} == 0x17 ? 0x7 : $_->{pt_type}; my $pt_type = typeOfPart($_->{device}); $_->{pt_type} = $pt_type if ($pt_type & 0xff) == $wanted_pt_type || $pt_type && $hd->isa('partition_table::gpt'); } - foreach (partition_table::get_normal_parts($hd)) { + foreach (@parts) { my $label = member(type2fs($_), qw(ext2 ext3)) ? c::get_ext2_label(devices::make($_->{device})) : @@ -240,7 +242,7 @@ sub hds { } if ($hd->{usb_media_type}) { - $_->{is_removable} = 1 foreach partition_table::get_normal_parts($hd); + $_->{is_removable} = 1 foreach @parts; } push @hds, $hd; -- cgit v1.2.1