summaryrefslogtreecommitdiffstats
path: root/lib/private/Files/Mount
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2018-03-26 16:48:20 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2018-04-04 12:44:28 +0200
commitdc222aa3a50c32fb1aa9801ad7fedf98325477e8 (patch)
tree0efb6357da25ada997223cea406774351b29ef48 /lib/private/Files/Mount
parente48d4c4aad1216a64d52ad5d87b0478944ce577f (diff)
downloadnextcloud-server-dc222aa3a50c32fb1aa9801ad7fedf98325477e8.tar.gz
nextcloud-server-dc222aa3a50c32fb1aa9801ad7fedf98325477e8.zip
Comparing stringlength is cheaper than strpos
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/private/Files/Mount')
-rw-r--r--lib/private/Files/Mount/Manager.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/private/Files/Mount/Manager.php b/lib/private/Files/Mount/Manager.php
index 7f21a1e7f99..d98d45ae0b7 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);
}