projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add more code gradually
[spider.git]
/
perl
/
Filter.pm
diff --git
a/perl/Filter.pm
b/perl/Filter.pm
index 0ca71917db987cb5637ebe5bec404b1ddb611e64..2403ace860d60412f1fd387971b50077290eb19a 100644
(file)
--- a/
perl/Filter.pm
+++ b/
perl/Filter.pm
@@
-36,7
+36,7
@@
use strict;
use vars qw($VERSION $BRANCH);
$VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ );
use vars qw($VERSION $BRANCH);
$VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ );
-$BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/
||
(0,0));
+$BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/
,
(0,0));
$main::build += $VERSION;
$main::branch += $BRANCH;
$main::build += $VERSION;
$main::branch += $BRANCH;
@@
-92,7
+92,9
@@
sub compile
my $rr;
if ($ref->{$ar} && exists $ref->{$ar}->{asc}) {
my $rr;
if ($ref->{$ar} && exists $ref->{$ar}->{asc}) {
- $ref->{$ar}->{code} = eval "sub { my \$r=shift; return $ref->{$ar}->{asc}; }" ;
+ my $s = $ref->{$ar}->{asc}; # an optimisation?
+ $s =~ s/\$r/\$_[0]/g;
+ $ref->{$ar}->{code} = eval "sub { $s }" ;
if ($@) {
my $sort = $ref->{sort};
my $name = $ref->{name};
if ($@) {
my $sort = $ref->{sort};
my $name = $ref->{name};