Cache the $foundMountPointLength
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
parent
003c624596
commit
e48d4c4aad
|
@ -79,9 +79,11 @@ class Manager implements IMountManager {
|
||||||
\OC_Hook::emit('OC_Filesystem', 'get_mountpoint', ['path' => $path]);
|
\OC_Hook::emit('OC_Filesystem', 'get_mountpoint', ['path' => $path]);
|
||||||
$foundMountPoint = '';
|
$foundMountPoint = '';
|
||||||
$mountPoints = array_keys($this->mounts);
|
$mountPoints = array_keys($this->mounts);
|
||||||
|
$foundMountPointLength = 0;
|
||||||
foreach ($mountPoints as $mountpoint) {
|
foreach ($mountPoints as $mountpoint) {
|
||||||
if (strpos($path, $mountpoint) === 0 && \strlen($mountpoint) > \strlen($foundMountPoint)) {
|
if (strpos($path, $mountpoint) === 0 && \strlen($mountpoint) > $foundMountPointLength) {
|
||||||
$foundMountPoint = $mountpoint;
|
$foundMountPoint = $mountpoint;
|
||||||
|
$foundMountPointLength = \strlen($foundMountPoint);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue