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

ruz at bestpractical.com ruz at bestpractical.com
Wed Oct 3 07:01:40 EDT 2007


Author: ruz
Date: Wed Oct  3 07:01:40 2007
New Revision: 9196

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

Log:
 r18252 at cubic-pc:  cubic | 2007-10-03 04:18:28 +0400
 * get rid of three calls to defn()


Modified: Text-Quoted/Quoted.pm
==============================================================================
--- Text-Quoted/Quoted.pm	(original)
+++ Text-Quoted/Quoted.pm	Wed Oct  3 07:01:40 2007
@@ -92,20 +92,22 @@
 sub organize {
     my $top_level = shift;
     my @todo      = @_;
+    $top_level = '' unless defined $top_level;
+
     my @ret;
 
     # Recursively form a data structure which reflects the quoting
     # structure of the list.
-    while (@todo) {
-        my $line = shift @todo;
-        if ( defn( $line->{quoter} ) eq defn($top_level) ) {
+    while (my $line = shift @todo) {
+        my $q = defined $line->{quoter}? $line->{quoter}: '';
+        if ( $q eq $top_level ) {
 
             # Just append lines at "my" level.
             push @ret, $line
               if exists $line->{quoter}
               or exists $line->{empty};
         }
-        elsif ( defn( $line->{quoter} ) =~ /^\Q$top_level\E.+/ ) {
+        elsif ( $q =~ /^\Q$top_level\E./ ) {
 
             # Find all the lines at a quoting level "below" me.
             my $newquoter = find_below( $top_level, $line, @todo );



More information about the Bps-public-commit mailing list