Issue Bug Closed

#53556classLoader->loadClass calls requireOnce twice per class

Ingo Schmitt 11/12/13, 13:11 updated 01/27/14, 10:22

Description

Inside classLoad->LoadClass each class is loaded in line 134, but again in line 156.

134:

// Loads any known class via caching framework
        if ($require) {
            if ($this->classesCache->requireOnce($cacheEntryIdentifier) !== FALSE) {
                $cacheEntryCreated = TRUE;
            }
        }

156:

        if ($cacheEntryCreated && $require) {
            if ($this->classesCache->requireOnce($cacheEntryIdentifier) !== FALSE) {
                $cacheEntryCreated = TRUE;
            }
        }

By looking into the logic, it seams if a require was successful in the first part, the require is repeated in the second part. You could speed it up by checking if the require was successful in the first part and avoid the second require.

Reviews 1