[Bps-public-commit] r9198 - Text-Quoted

ruz at bestpractical.com ruz at bestpractical.com
Wed Oct 3 07:02:03 EDT 2007


Author: ruz
Date: Wed Oct  3 07:02:00 2007
New Revision: 9198

Modified:
   Text-Quoted/   (props changed)
   Text-Quoted/Quoted.pm

Log:
 r18254 at cubic-pc:  cubic | 2007-10-03 13:38:14 +0400
 * use "my" hash instead of constantly looking for a last element of the array


Modified: Text-Quoted/Quoted.pm
==============================================================================
--- Text-Quoted/Quoted.pm	(original)
+++ Text-Quoted/Quoted.pm	Wed Oct  3 07:02:00 2007
@@ -177,18 +177,19 @@
     my $pre = 0;
     my @lines;
     foreach (@rawlines) {
-        push @lines, { raw => $_};
+        my %line = ( raw => $_ );
         s/\A([ \t]*)($quoter?)([ \t]*)//;
-        $lines[-1]{presig} = $lines[-1]{prespace} = defn $1;
-        $lines[-1]{presig} .= $lines[-1]{quoter}     = defn $2;
-        $lines[-1]{presig} .= $lines[-1]{quotespace} = defn $3;
-        $lines[-1]{hang} = defn( Hang->new($_) );
+        $line{presig} = $line{prespace} = defn $1;
+        $line{presig} .= $line{quoter}     = defn $2;
+        $line{presig} .= $line{quotespace} = defn $3;
+        $line{hang} = defn( Hang->new($_) );
 
         s/([ \t]*)(.*?)(\s*)$//;
-        $lines[-1]{hangspace} = defn $1;
-        $lines[-1]{text}      = defn $2;
-        $lines[-1]{empty}     = $lines[-1]{hang}->empty() && $2 !~ /\S/;
-        $lines[-1]{separator} = $lines[-1]{text} =~ /^$separator$/;
+        $line{hangspace} = defn $1;
+        $line{text}      = defn $2;
+        $line{empty}     = $line{hang}->empty() && $2 !~ /\S/;
+        $line{separator} = $line{text} =~ /^$separator$/;
+        push @lines, \%line;
     }
 
     # SUBDIVIDE DOCUMENT INTO COHERENT SUBSECTIONS



More information about the Bps-public-commit mailing list