summaryrefslogtreecommitdiffstats
path: root/tests/mocks/autoloader.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-11-02 22:33:45 +0100
committerAndrey Andreev <narf@bofh.bg>2012-11-02 22:33:45 +0100
commite24eed7e4e410fabf7479a67d3a27e2596444505 (patch)
treeb751d0553e2a72dc0dbe909b3c7db1fc0d4d2f5c /tests/mocks/autoloader.php
parent533bf2dd5f36e277a9ee6629ccd667a32b05d154 (diff)
Some micro-optimizations
Diffstat (limited to 'tests/mocks/autoloader.php')
-rw-r--r--tests/mocks/autoloader.php8
1 files changed, 3 insertions, 5 deletions
diff --git a/tests/mocks/autoloader.php b/tests/mocks/autoloader.php
index 5b202f159..4fc9c63b6 100644
--- a/tests/mocks/autoloader.php
+++ b/tests/mocks/autoloader.php
@@ -38,13 +38,11 @@ function autoload($class)
if (strpos($class, 'Mock_') === 0)
{
- $class = str_replace(array('Mock_', '_'), array('', DIRECTORY_SEPARATOR), $class);
- $class = strtolower($class);
+ $class = strtolower(str_replace(array('Mock_', '_'), array('', DIRECTORY_SEPARATOR), $class));
}
elseif (strpos($class, 'CI_') === 0)
{
- $fragments = explode('_', $class, 2);
- $subclass = next($fragments);
+ $subclass = substr($class, 3);
if (in_array($subclass, $ci_core))
{
@@ -88,7 +86,7 @@ function autoload($class)
}
}
- $file = (isset($file)) ? $file : $dir.$class.'.php';
+ $file = isset($file) ? $file : $dir.$class.'.php';
if ( ! file_exists($file))
{