[Date Index][Thread Index]
[Date Prev][Date Next][Thread Prev][Thread Next]

[PATCH] wml_p5_divert dramatically slow in WML-1.7.3



Anthony Fok send me a bug report, complaining that wml_p5_divert is a lot
slower in WML-1.7.3.

Below is a patch to fix this problem, i strongly encourage you to apply
it.

--- divert.src	1999/09/19 16:20:42	1.3
+++ divert.src	1999/10/03 19:38:38
@@ -217,12 +217,8 @@
         my $i2 = index($remain, '..');  $i2 = ($i2 == -1 ? $l : $i2);
         my $i3 = index($remain, '{#');  $i3 = ($i3 == -1 ? $l : $i3);
         #   we cannot check ':[NAME]#}' directly
-        if ($remain =~ m/:[a-zA-Z][a-zA-Z0-9_]*#}/) {
-            my $i4 = length($`);
-        }
-        else {
-            my $i4 = $l;
-        }
+        my $i4 = index($remain, ':');   $i4 = ($i4 == -1 ? $l : $i4);
+
         my $i = $i1;
         $i = ($i  < $i2 ? $i  : $i2);
         $i = ($i  < $i3 ? $i  : $i3);



-- 
Denis Barbier
WML Maintainer

--- divert.src	1999/09/19 16:20:42	1.3
+++ divert.src	1999/10/03 19:38:38
@@ -217,12 +217,8 @@
         my $i2 = index($remain, '..');  $i2 = ($i2 == -1 ? $l : $i2);
         my $i3 = index($remain, '{#');  $i3 = ($i3 == -1 ? $l : $i3);
         #   we cannot check ':[NAME]#}' directly
-        if ($remain =~ m/:[a-zA-Z][a-zA-Z0-9_]*#}/) {
-            my $i4 = length($`);
-        }
-        else {
-            my $i4 = $l;
-        }
+        my $i4 = index($remain, ':');   $i4 = ($i4 == -1 ? $l : $i4);
+
         my $i = $i1;
         $i = ($i  < $i2 ? $i  : $i2);
         $i = ($i  < $i3 ? $i  : $i3);