summaryrefslogtreecommitdiffstats
path: root/zarb-ml/mageia-dev/attachments/20120406/427b6f6a/attachment-0001.obj
blob: f257c6cf18fea5b218aef340bece3523aa9fc9fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
--- gpt.pm.tv	2012-04-06 09:49:39.652735735 +0200
+++ gpt.pm	2012-04-06 09:54:11.720110925 +0200
@@ -31,16 +31,8 @@
         $p{part_number} => \%p;
     } c::get_disk_partitions($hd->{file});
 
-    my @pt = map {
-	my $part_number = $_;
-	if ($parts{$part_number}) {
-	    $parts{$part_number};
-	} else {
-	    my %p;
-	    $p{part_number} = $part_number;
-	    \%p;
-	}
-    } (1..$nb_primary);
+    add2hash(\%parts, { map { (part_number => $_) } 1..$nb_primary });
+    my @pt = map { $parts{$_} } sort keys %parts;
 
     [ @pt ], $info;
 }