[Bps-public-commit] r15969 - Prophet/trunk/lib/Prophet/CLI/Command
jesse at bestpractical.com
jesse at bestpractical.com
Mon Sep 15 00:18:11 EDT 2008
Author: jesse
Date: Mon Sep 15 00:16:57 2008
New Revision: 15969
Modified:
Prophet/trunk/lib/Prophet/CLI/Command/Search.pm
Log:
* slight changes to how command::search calls the sort subroutine to not read weirdly.
Modified: Prophet/trunk/lib/Prophet/CLI/Command/Search.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/CLI/Command/Search.pm (original)
+++ Prophet/trunk/lib/Prophet/CLI/Command/Search.pm Mon Sep 15 00:16:57 2008
@@ -14,8 +14,8 @@
required => 0,
# default subs are executed immediately, hence the weird syntax for coderefs
default => sub { sub {
- my @records = @{ $_[0] };
- return (sort { $a->luid <=> $b->luid } @records);
+ my $records = shift;
+ return (sort { $a->luid <=> $b->luid } @$records);
} },
documentation => 'A subroutine which takes a hashref to a list of records and returns them sorted in some way.',
);
@@ -115,9 +115,8 @@
my $self = shift;
my $records = shift;
- my $sort_routine = $self->sort_routine;
-
- for ( &$sort_routine( scalar $records->items ) ) {
+ my $items = $records->items;
+ for ( $self->sort_routine->( $items) ) {
print $_->format_summary . "\n";
}
}
More information about the Bps-public-commit
mailing list