Merge pull request #6442 from sensorario/performance-improvement

Compute size of loaders in the test suite beforehand, and not on each iteration
This commit is contained in:
Marco Pivetta
2017-05-16 13:40:17 +02:00
committed by GitHub

View File

@@ -35,7 +35,8 @@ class SetupTest extends OrmTestCase
set_include_path($this->originalIncludePath);
$loaders = spl_autoload_functions();
for ($i = 0; $i < count($loaders); $i++) {
$numberOfLoaders = count($loaders);
for ($i = 0; $i < $numberOfLoaders; $i++) {
if ($i > $this->originalAutoloaderCount+1) {
spl_autoload_unregister($loaders[$i]);
}