From dc222aa3a50c32fb1aa9801ad7fedf98325477e8 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Mon, 26 Mar 2018 16:48:20 +0200 Subject: [PATCH] Comparing stringlength is cheaper than strpos Signed-off-by: Roeland Jago Douma --- lib/private/Files/Mount/Manager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/private/Files/Mount/Manager.php b/lib/private/Files/Mount/Manager.php index 7f21a1e7f9..d98d45ae0b 100644 --- a/lib/private/Files/Mount/Manager.php +++ b/lib/private/Files/Mount/Manager.php @@ -81,7 +81,7 @@ class Manager implements IMountManager { $mountPoints = array_keys($this->mounts); $foundMountPointLength = 0; foreach ($mountPoints as $mountpoint) { - if (strpos($path, $mountpoint) === 0 && \strlen($mountpoint) > $foundMountPointLength) { + if (\strlen($mountpoint) > $foundMountPointLength && strpos($path, $mountpoint) === 0) { $foundMountPoint = $mountpoint; $foundMountPointLength = \strlen($foundMountPoint); }