1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-01-29 12:43:15 +01:00

[ticket/14540] Adjust recursive_dot_prefix_filter_iterator for performance

Swapping conditions in the function accept() of the class
\phpbb\recursive_dot_prefix_filter_iterator saves a lot of isDir() calls which
is more expensive than $filename[0] checks.

PHPBB3-14540
This commit is contained in:
rxu 2016-03-17 00:50:08 +07:00
parent f1874ec416
commit e610b23916

View File

@ -25,6 +25,6 @@ class recursive_dot_prefix_filter_iterator extends \RecursiveFilterIterator
public function accept()
{
$filename = $this->current()->getFilename();
return !$this->current()->isDir() || $filename[0] !== '.';
return $filename[0] !== '.' || !$this->current()->isDir();
}
}