Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
In theme(), $info is defined as $hooks[$hook] and then several times later when a value is needed $hooks[$hook] is used instead of $info.
This patch replaces those with $info. PHP should be faster doing a direct array lookup rather than a nested array with a variable key lookup. Probably not by much, but theme() is called a lot.
Or maybe it's done this way because the theme registry is possibly being modified during execution?
Comment | File | Size | Author |
---|---|---|---|
infojv.patch | 1.54 KB | jvandyk | |
Comments
Comment #1
dvessel CreditAttribution: dvessel commentedI've dug into the registry and how theme() interacts with it. I think this is fine. $hooks[$hook] and $info will never differ. Tested to verify. Checked with devel themer also. If anything would break this, it would be that module.
It applies to 7 also where it should be applied first.
Comment #2
Dries CreditAttribution: Dries commentedI committed this to CVS HEAD. I didn't bother to commit it to D6 -- I'm not sure that is necessary.
Comment #3
moshe weitzman CreditAttribution: moshe weitzman commented@dvessel - i just branched devel project for D6. could you please commit this to HEAD devel_themer so we stay in sync?
Comment #4
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.