Skip to content

Commit

Permalink
Slight micro-optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
ircmaxell committed Mar 26, 2011
1 parent 06a6aaa commit 8029464
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/CryptLib/Core/AbstractFactory.php
Expand Up @@ -72,7 +72,7 @@ protected function registerType(
protected function loadFiles($directory, $namespace, $callback) {
foreach (new \DirectoryIterator($directory) as $file) {
$filename = $file->getBasename();
if ($file->isFile() && preg_match('/\.php$/', $filename)) {
if ($file->isFile() && substr($filename, -4) == '.php') {
$name = substr($filename, 0, -4);
$class = $namespace . $name;
call_user_func($callback, $name, $class);
Expand Down

0 comments on commit 8029464

Please sign in to comment.