You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl-cvs@perl.apache.org by to...@apache.org on 2011/04/25 21:01:15 UTC

svn commit: r1096564 - /perl/modperl/trunk/src/modules/perl/modperl_module.c

Author: torsten
Date: Mon Apr 25 19:01:15 2011
New Revision: 1096564

URL: http://svn.apache.org/viewvc?rev=1096564&view=rev
Log:
avoid a superfluous module list scan in modperl_module_insert()

Modified:
    perl/modperl/trunk/src/modules/perl/modperl_module.c

Modified: perl/modperl/trunk/src/modules/perl/modperl_module.c
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/src/modules/perl/modperl_module.c?rev=1096564&r1=1096563&r2=1096564&view=diff
==============================================================================
--- perl/modperl/trunk/src/modules/perl/modperl_module.c (original)
+++ perl/modperl/trunk/src/modules/perl/modperl_module.c Mon Apr 25 19:01:15 2011
@@ -741,8 +741,6 @@ static const char *modperl_module_add_cm
 
 static void modperl_module_insert(module *modp)
 {
-    module *m;
-
     /*
      * insert after mod_perl, rather the top of the list.
      * (see ap_add_module; does not insert into ap_top_module list if
@@ -750,14 +748,8 @@ static void modperl_module_insert(module
      * this way, modperl config merging happens before this module.
      */
 
-    for (m = ap_top_module; m; m=m->next) {
-        if (m == &perl_module) {
-            module *next = m->next;
-            m->next = modp;
-            modp->next = next;
-            break;
-        }
-    }
+    modp->next = perl_module.next;
+    perl_module.next = modp;
 }
 
 #define MP_isGV(gv) (gv && isGV(gv))