Comparing stringlength is cheaper than strpos
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
parent
e48d4c4aad
commit
dc222aa3a5
|
@ -81,7 +81,7 @@ class Manager implements IMountManager {
|
||||||
$mountPoints = array_keys($this->mounts);
|
$mountPoints = array_keys($this->mounts);
|
||||||
$foundMountPointLength = 0;
|
$foundMountPointLength = 0;
|
||||||
foreach ($mountPoints as $mountpoint) {
|
foreach ($mountPoints as $mountpoint) {
|
||||||
if (strpos($path, $mountpoint) === 0 && \strlen($mountpoint) > $foundMountPointLength) {
|
if (\strlen($mountpoint) > $foundMountPointLength && strpos($path, $mountpoint) === 0) {
|
||||||
$foundMountPoint = $mountpoint;
|
$foundMountPoint = $mountpoint;
|
||||||
$foundMountPointLength = \strlen($foundMountPoint);
|
$foundMountPointLength = \strlen($foundMountPoint);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue