[Bps-public-commit] r9195 - Text-Quoted
ruz at bestpractical.com
ruz at bestpractical.com
Wed Oct 3 07:01:29 EDT 2007
Author: ruz
Date: Wed Oct 3 07:01:21 2007
New Revision: 9195
Modified:
Text-Quoted/ (props changed)
Text-Quoted/Quoted.pm
Log:
r18251 at cubic-pc: cubic | 2007-10-03 04:13:34 +0400
* do the same using faster code
** don't create local vars at all
** create a hash ref using direct typing instead of mapping
* looks elegant and clear
Modified: Text-Quoted/Quoted.pm
==============================================================================
--- Text-Quoted/Quoted.pm (original)
+++ Text-Quoted/Quoted.pm Wed Oct 3 07:01:21 2007
@@ -60,14 +60,14 @@
=cut
sub extract {
- my $text = shift;
- my @paras = classify($text);
- my @needed;
- for my $p (@paras) {
- push @needed, { map { $_ => $p->{$_} } qw(raw empty text quoter) };
- }
-
- return organize( "", @needed );
+ return organize( "",
+ map +{
+ raw => $_->{'raw'},
+ empty => $_->{'empty'},
+ text => $_->{'text'},
+ quoter => $_->{'quoter'},
+ }, classify( @_ )
+ );
}
=head1 CREDITS
More information about the Bps-public-commit
mailing list