develooper Front page | perl.perl5.porters | Postings from January 2015

[perl #123635] [PATCH] collapse 2 regexps in win32/FindExt.pm

From:
Tony Cook via RT
Date:
January 26, 2015 23:17
Subject:
[perl #123635] [PATCH] collapse 2 regexps in win32/FindExt.pm
Message ID:
rt-4.0.18-8989-1422314268-1478.123635-15-0@perl.org
On Tue Jan 20 03:25:41 2015, bulk88 wrote:
> See attached patch.
> 
> sub has_xs_or_c {
>      my $dir = shift;
> +    my $item;
>      opendir my $dh, $dir or die "opendir $dir: $!";
> -    while (defined (my $item = readdir $dh)) {
> -        return 1 if $item =~ /\.xs$/;
> -        return 1 if $item =~ /\.c$/;
> -    }
> +    $item =~ /\.(?:xs|c)$/ ? return 1 : () while defined ($item = readdir $dh);
>      return 0;
>  }

Based on the discussion and my own opinion of the change shown above, 
rejecting this patch and ticket.

Tony

---
via perlbug:  queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=123635



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About