[Po4a-commits] "po4a/lib/Locale/Po4a Sgml.pm,1.69,1.70"

Nicolas FRANCOIS nekral-guest at alioth.debian.org
Wed Sep 14 08:08:13 UTC 2005


Update of /cvsroot/po4a/po4a/lib/Locale/Po4a
In directory haydn:/tmp/cvs-serv29019/lib/Locale/Po4a

Modified Files:
	Sgml.pm 
Log Message:
Speed improvement. There are a few included files compared to the other
entities.


Index: Sgml.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Sgml.pm,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -d -r1.69 -r1.70
--- Sgml.pm	14 Sep 2005 08:01:42 -0000	1.69
+++ Sgml.pm	14 Sep 2005 08:08:11 -0000	1.70
@@ -606,10 +606,9 @@
     }
 
     #   Change the entities including files in the document
-    while ($origfile =~
-        /^(.*?)&([A-Za-z_:][-_:.A-Za-z0-9]*|#[0-9]+|#x[0-9a-fA-F]+);(.*)$/s) {
-	if (defined $entincl{$2}) {
-	    my ($begin,$key,$end)=($1,$2,$3);
+    foreach my $key (keys %entincl) {
+        while ($origfile =~/^(.*?)&$key;(.*)$/s) {
+	    my ($begin,$end)=($1,$2);
 	    $end =~ s/^\s*\n//s;
 
 	    # add the refs
@@ -641,11 +640,10 @@
 	    # Do the substitution
 	    $origfile = "$begin".$entincl{$key}{'content'}."$end";
 	    print STDERR "substitute $2\n" if ($debug{'entities'});
-	} else {
-	    $origfile = "$1".'{PO4A-amp}'."$2;$3";
-	    print STDERR "preserve $2\n" if ($debug{'entities'});
-	}
+        }
     }
+    $origfile=~s/\G(.*?)&([A-Za-z_:][-_:.A-Za-z0-9]*|#[0-9]+|#x[0-9a-fA-F]+);/$1\{PO4A-amp\}$2;/gs;
+}
 
     if ($debug{'refs'}) {
 	print "XX Resulting shifts\n";




More information about the Po4a-commits mailing list