foreach (_token_core_supported_modules() as $module) {
      if (module_exists($module)) {
        $implementations[$module] = TRUE;

Sets TRUE when the module is internally supported by the token module. This parameter is supposed to be the $group parameter (either FALSE, either a string).

When module_load_include() is called by module_implements() it does this:

module_load_include('inc', $module, "$module.$group");

Which can be translated into:
module_load_include('inc', $module, "$module." . TRUE);

Which then is converted to the following filename (example for the field module):

Which then cause an additional is_file() call by module_load_include() which could be avoided.

The easy fix is just replacing the TRUE by FALSE.


Dave Reid’s picture

Status:Active» Fixed

Yep, you're right. This is now fixed with

pounard’s picture

Thanks! Quick and clean.

Status:Fixed» Closed (fixed)

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