Skip to content

Commit

Permalink
Omit each for arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
vaeth committed Mar 1, 2018
1 parent 7163102 commit c9d040f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 17 deletions.
39 changes: 25 additions & 14 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
# ChangeLog for find_cruft

*find_cruft-v4.1.0
*find_cruft-5.1
Martin Väth <martin at mvath.de>:
- Do not use ($i, $a) = each for arrays, since it requires perl-5.12,
and moreover, unspecified problems have been reported by coseltech,
see https://github.com/vaeth/find_cruft/issues/2

*find_cruft-5
Martin Väth <martin at mvath.de>:
- Fix/extend default config file names
- Prepare for SYMLINK_LIBS=no

*find_cruft-4.1.0
Martin Väth <martin at mvath.de>:
- Fix typo in default config name /usr/lib/find_cruft/find_cruft.pl
- Add also /usr/share/find_cruft/find_cruft{.pl,.d} to optional configs
Expand All @@ -13,56 +24,56 @@
- Drop some redundant scalar()
- Cosmetical source code formatting

*find_cruft-v4.0.0
*find_cruft-4.0.0
Martin Väth <martin at mvath.de>:
- Change format for specifying configuration files and default list
- Read by default config files from /usr/lib/find_cruft as a fallback
default if the files in /etc do not exist or are not readable
- Do not read any config file from the home directory by default
- Formulate zsh-completion help in a more standard manner

*find_cruft-v3.1.0
*find_cruft-3.1.0
Martin Väth <martin at mvath.de>:
- Fix regression of v3.0.10 which completely broke the package:
- Fix regression of 3.0.10 which completely broke the package:
- Handle $VERSION workaround correctly

*find_cruft-v3.0.10
*find_cruft-3.0.10
Martin Väth <martin at mvath.de>:
- Force utf8 in manpage
- Lower required perl version
- Check perl version at compile time

*find_cruft-v3.0.9
*find_cruft-3.0.9
Martin Väth <martin at mvath.de>:
- Work (rudimentary) if no config file is read

*find_cruft-v3.0.8
*find_cruft-3.0.8
Martin Väth <martin at mvath.de>:
- Syntactic micro-optimization

*find_cruft-v3.0.7
*find_cruft-3.0.7
Martin Väth <martin at mvath.de>:
- Prefer each() and join() over index bookkeeping

*find_cruft-v3.0.6
*find_cruft-3.0.6
Martin Väth <martin at mvath.de>:
- Fix --Output (no_case_ignore)

*find_cruft-v3.0.5
*find_cruft-3.0.5
Martin Väth <martin at mvath.de>:
- Fix --output --Output -o -O
- use gnu_getopt

*find_cruft-v3.0.4
*find_cruft-3.0.4
Martin Väth <martin at mvath.de>:
- Fix wrong usage of "main". Regression since v3.0.1
- Fix wrong usage of "main". Regression since 3.0.1

*find_cruft-v3.0.3
*find_cruft-3.0.3
Martin Väth <martin at mvath.de>:
- require pod2usage only if necessary; don't use version
- Replace 'EOF' by 1 to avoid stupid new perl warning

*find_cruft-v3.0.1
*find_cruft-3.0.1
Martin Väth <martin at mvath.de>:
- Use perl-5.12 package versioning, dotted-decimal version
- Require correct perl/module versions
Expand Down
8 changes: 5 additions & 3 deletions bin/find_cruft
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env perl
BEGIN { require 5.008 }
package FindCruft;
our $VERSION = 'v5.0.0';
our $VERSION = 'v5.1.0';
eval { $VERSION = version->declare($VERSION) };
eval 'use version 0.77; $VERSION = version->declare($VERSION)' if ($@);

Expand Down Expand Up @@ -575,7 +575,8 @@ sub prepare_symlinks {
next unless (defined($i) && (ref($i) eq 'ARRAY'));
my $r = [];
my $last = scalar(@$i) - 1;
while (my ($j, $s) = each(@$i)) {
for (my $j = 0; $j < @$i; ++$j) {
my $s = $i->[$j];
next unless (defined($s) && File::Spec->file_name_is_absolute($s));
$s = &normalized($s);
if ($j < $last) {
Expand Down Expand Up @@ -690,7 +691,8 @@ sub wanted_skip {
my $length = 0;
my $last = scalar(@$i) - 1;
my $s;
while ((my $j, $s) = each(@$i)) {
for (my $j = 0; $j < @$i; ++$j) {
$s = $i->[$j];
last if ($j >= $last);
my $l = length($s);
next if ($l > $pathlen);
Expand Down

0 comments on commit c9d040f

Please sign in to comment.