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/014760.html | 151 ++++++++++++++++++++++++++++++ 1 file changed, 151 insertions(+) create mode 100644 zarb-ml/mageia-dev/2012-April/014760.html (limited to 'zarb-ml/mageia-dev/2012-April/014760.html') diff --git a/zarb-ml/mageia-dev/2012-April/014760.html b/zarb-ml/mageia-dev/2012-April/014760.html new file mode 100644 index 000000000..c42840ff6 --- /dev/null +++ b/zarb-ml/mageia-dev/2012-April/014760.html @@ -0,0 +1,151 @@ + + + + [Mageia-dev] [soft-commits] [4252] fix removing several notebook pages + + + + + + + + + +

[Mageia-dev] [soft-commits] [4252] fix removing several notebook pages

+ Guillaume Rousse + guillomovitch at gmail.com +
+ Wed Apr 25 10:15:13 CEST 2012 +

+
+ +
Le 25/04/2012 09:56, Thierry Vignaud a écrit :
+> On 24 April 2012 23:17,<root at mageia.org>  wrote:
+>> fix removing several notebook pages
+>
+> (...)
+>
+>> --- drakx/trunk/perl-install/diskdrake/hd_gtk.pm	2012-04-24 20:10:47 UTC
+>> (rev 4251)
+>> +++ drakx/trunk/perl-install/diskdrake/hd_gtk.pm	2012-04-24 21:17:30 UTC
+>> (rev 4252)
+>> @@ -285,9 +285,15 @@
+>>       $may_add->(raid2kind()) if @{$all_hds->{raids}};
+>>       $may_add->(loopback2kind()) if @{$all_hds->{loopbacks}};
+>>
+>> -    @notebook = grep_index {
+>> -	my $b = $_->{marked} or $notebook_widget->remove_page($::i);
+>> -	$b;
+>> +    my $i = 0;
+>> +    @notebook = grep {
+>> +	if ($_->{marked}) {
+>> +	    $i++;
+>> +	    1;
+>> +	} else {
+>> +	    $notebook_widget->remove_page($i);
+>> +	    0;
+>> +	}
+>
+> Wouldn't have been simpler to decrease $::i instead?
+I'm more concerned about the ugly mix between variable affectation ( 
+@notebook = grep {} @list) and additional concerns hidden inside 
+($notebook_widget->remove_page($i) ). And explicit loop would be easier 
+to understand, and less error-prone:
+
+my @notebook;
+my $i = 0;
+foreach my $notebook (@list) {
+     if ($notebook->{marked}) {
+         push @notebook, $notebook;
+         $i++;
+     } else {
+         $notebook_widget->remove_page($i);
+     }
+}
+
+-- 
+BOFH excuse #136:
+
+Daemons loose in system.
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

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