Skip to content

Commit f98fed3

Browse files
committed
reuse usermanager instance when processing search results
saves some time when processing large search results Signed-off-by: Robin Appelman <robin@icewind.nl>
1 parent 62929cc commit f98fed3

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

lib/private/Files/View.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1643,6 +1643,7 @@ private function searchCommon($method, $args) {
16431643
$mount = $this->getMount('');
16441644
$mountPoint = $mount->getMountPoint();
16451645
$storage = $mount->getStorage();
1646+
$userManager = \OC::$server->getUserManager();
16461647
if ($storage) {
16471648
$cache = $storage->getCache('');
16481649

@@ -1652,7 +1653,7 @@ private function searchCommon($method, $args) {
16521653
$internalPath = $result['path'];
16531654
$path = $mountPoint . $result['path'];
16541655
$result['path'] = substr($mountPoint . $result['path'], $rootLength);
1655-
$owner = \OC::$server->getUserManager()->get($storage->getOwner($internalPath));
1656+
$owner = $userManager->get($storage->getOwner($internalPath));
16561657
$files[] = new FileInfo($path, $storage, $internalPath, $result, $mount, $owner);
16571658
}
16581659
}
@@ -1671,7 +1672,7 @@ private function searchCommon($method, $args) {
16711672
$internalPath = $result['path'];
16721673
$result['path'] = rtrim($relativeMountPoint . $result['path'], '/');
16731674
$path = rtrim($mountPoint . $internalPath, '/');
1674-
$owner = \OC::$server->getUserManager()->get($storage->getOwner($internalPath));
1675+
$owner = $userManager->get($storage->getOwner($internalPath));
16751676
$files[] = new FileInfo($path, $storage, $internalPath, $result, $mount, $owner);
16761677
}
16771678
}

0 commit comments

Comments
 (0)