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?

CommentFileSizeAuthor
infojv.patch1.54 KBjvandyk
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dvessel’s picture

Version: 6.x-dev » 7.x-dev
Status: Needs review » Reviewed & tested by the community

I'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.

Dries’s picture

Status: Reviewed & tested by the community » Fixed

I committed this to CVS HEAD. I didn't bother to commit it to D6 -- I'm not sure that is necessary.

moshe weitzman’s picture

@dvessel - i just branched devel project for D6. could you please commit this to HEAD devel_themer so we stay in sync?

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.