diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2004-08-12 04:46:01 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2004-08-12 04:46:01 +0000 |
commit | c927e68bfd5e070d666642de786a971b9f0330e9 (patch) | |
tree | 012c5276c3678c50f0a02b43a4deba27081b5df5 /perl_checker.src/test | |
parent | 230f4ddd8cbac8d2be387810de58248900004243 (diff) | |
download | perl_checker-c927e68bfd5e070d666642de786a971b9f0330e9.tar perl_checker-c927e68bfd5e070d666642de786a971b9f0330e9.tar.gz perl_checker-c927e68bfd5e070d666642de786a971b9f0330e9.tar.bz2 perl_checker-c927e68bfd5e070d666642de786a971b9f0330e9.tar.xz perl_checker-c927e68bfd5e070d666642de786a971b9f0330e9.zip |
you can replace "grep { !member($_, ...) } @l" with "difference2([ @l ], [ ... ])"
Diffstat (limited to 'perl_checker.src/test')
-rw-r--r-- | perl_checker.src/test/suggest_better.t | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/perl_checker.src/test/suggest_better.t b/perl_checker.src/test/suggest_better.t index be238a2..d3af927 100644 --- a/perl_checker.src/test/suggest_better.t +++ b/perl_checker.src/test/suggest_better.t @@ -72,6 +72,8 @@ member($xxx, keys %h) you can replace "member($xxx, keys %yyy !($xxx eq 'foo') !($foo eq $bar) is better written $foo ne $bar +grep { !member($_, qw(a b c)) } @l you can replace "grep { !member($_, ...) } @l" with "difference2([ @l ], [ ... ])" + foreach (@l) { use "push @l2, grep { ... } ..." instead of "foreach (...) { push @l2, $_ if ... }" push @l2, $_ if yyy($_); or sometimes "@l2 = grep { ... } ..." } |