From e610b239169d604d5b880d14140f7fe25b15c392 Mon Sep 17 00:00:00 2001 From: rxu Date: Thu, 17 Mar 2016 00:50:08 +0700 Subject: [PATCH] [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 --- phpBB/phpbb/recursive_dot_prefix_filter_iterator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/phpbb/recursive_dot_prefix_filter_iterator.php b/phpBB/phpbb/recursive_dot_prefix_filter_iterator.php index 2500ba0cf8..1446551b8b 100644 --- a/phpBB/phpbb/recursive_dot_prefix_filter_iterator.php +++ b/phpBB/phpbb/recursive_dot_prefix_filter_iterator.php @@ -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(); } }