From 1be510f9529cb082f802408b472a77d074b394c0 Mon Sep 17 00:00:00 2001 From: Nicolas Vigier Date: Sun, 14 Apr 2013 13:46:12 +0000 Subject: Add zarb MLs html archives --- zarb-ml/mageia-dev/2012-April/013943.html | 125 ++++++++++++++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 zarb-ml/mageia-dev/2012-April/013943.html (limited to 'zarb-ml/mageia-dev/2012-April/013943.html') diff --git a/zarb-ml/mageia-dev/2012-April/013943.html b/zarb-ml/mageia-dev/2012-April/013943.html new file mode 100644 index 000000000..7ba8564ae --- /dev/null +++ b/zarb-ml/mageia-dev/2012-April/013943.html @@ -0,0 +1,125 @@ + + + + [Mageia-dev] [soft-commits] [3964] Fix partition numbering on GPT (mga#3091) + + + + + + + + + +

[Mageia-dev] [soft-commits] [3964] Fix partition numbering on GPT (mga#3091)

+ Guillaume Rousse + guillomovitch at gmail.com +
+ Fri Apr 6 10:34:57 CEST 2012 +

+
+ +
Le 06/04/2012 09:58, Thierry Vignaud a écrit :
+> On 6 April 2012 00:00,<root at mageia.org>  wrote:
+>> Fix partition numbering on GPT (mga#3091)
+>
+> (...)
+>
+>> @@ -27,9 +28,20 @@
+>>               $p{start} = $5;
+>>               $p{size} = $7;
+>>           }
+>> -        \%p;
+>> +        $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;
+>
+> This is simpler&  more readable:
+>
+> { part_number =>  $part_number };
+>
+> anyway it would be maybe simpler go one of the way I attach.
+> WDYT?
+I like the 'simpler' adjective when I have to read this stuff at least 3 
+times to get an idea of what it happening... A simple comment wouldn't 
+hurt there.
+
+Anyway, allocating the list content in a single pass seems simpler to 
+understand for me. I'd rather use something as:
+
+# create an exhaustive list including %parts content if existing
+# for given partition number, a default structure otherwise
+my @pt = map {
+         $parts{$_} ? $parts{$_} : { part_number => $_ }
+     } 1..$nb_primary;
+
+More general remarks:
+
+What about using consistent variable names ? If you have a collection of 
+'something' stored in a hash, why should it suddenly became of 
+collection of 'st' when transfering them into an array ? Or using a 
+consistent format for variables storing numbers, rather than having both 
+nb_foo and bar_number ?
+
+And I don't underestand the interest of using an hash for storing 
+content with numerical indexes only. Especially if you have to convert 
+it to an array at the end...
+
+-- 
+BOFH excuse #79:
+
+Look, buddy:  Windows 3.1 IS A General Protection Fault.
+
+ + + + + + + + + + + + + + +
+

+ +
+More information about the Mageia-dev +mailing list
+ -- cgit v1.2.1