diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2023-08-07 10:56:51 +0200 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2023-08-10 10:57:35 +0200 |
commit | c33c40f677f0d5b674a8ad4d1d4d6445ed2cf9ae (patch) | |
tree | c4e04778c2366c9634338547aeb995ce3b52bda0 /apps | |
parent | 1026b2131c53d074cf71e8e3ca4766b0a1b4ead3 (diff) | |
download | nextcloud-server-c33c40f677f0d5b674a8ad4d1d4d6445ed2cf9ae.tar.gz nextcloud-server-c33c40f677f0d5b674a8ad4d1d4d6445ed2cf9ae.zip |
[user_ldap] Small perf improvements suggestion from review
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/user_ldap/lib/Db/GroupMembershipMapper.php | 2 | ||||
-rw-r--r-- | apps/user_ldap/lib/Service/UpdateGroupsService.php | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/apps/user_ldap/lib/Db/GroupMembershipMapper.php b/apps/user_ldap/lib/Db/GroupMembershipMapper.php index 0868f60d2c5..8f6af16b267 100644 --- a/apps/user_ldap/lib/Db/GroupMembershipMapper.php +++ b/apps/user_ldap/lib/Db/GroupMembershipMapper.php @@ -47,7 +47,7 @@ class GroupMembershipMapper extends QBMapper { ->from($this->getTableName()) ->executeQuery(); - $groups = array_map(fn ($row) => $row['groupid'], $result->fetchAll()); + $groups = array_column($result->fetchAll(), 'groupid'); $result->closeCursor(); return $groups; } diff --git a/apps/user_ldap/lib/Service/UpdateGroupsService.php b/apps/user_ldap/lib/Service/UpdateGroupsService.php index 5e463734079..901b1e913eb 100644 --- a/apps/user_ldap/lib/Service/UpdateGroupsService.php +++ b/apps/user_ldap/lib/Service/UpdateGroupsService.php @@ -90,7 +90,7 @@ class UpdateGroupsService { $this->logger->debug('service "updateGroups" – Dealing with {group}.', ['group' => $group]); $groupMemberships = $this->groupMembershipMapper->findGroupMemberships($group); $knownUsers = array_map( - fn (GroupMembership $groupMembership): string => $groupMembership->getUserid(), + static fn (GroupMembership $groupMembership): string => $groupMembership->getUserid(), $groupMemberships ); $groupMemberships = array_combine($knownUsers, $groupMemberships); |