From: Robin Appelman Date: Wed, 11 Dec 2013 15:25:41 +0000 (+0100) Subject: user Group->users as assosiative array X-Git-Tag: v7.0.0alpha2~1029^2~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=3d299923786aa818aafeef1cb4dc3778b6fc1692;p=nextcloud-server.git user Group->users as assosiative array --- diff --git a/lib/private/group/group.php b/lib/private/group/group.php index 694827d100e..97f1cb8d960 100644 --- a/lib/private/group/group.php +++ b/lib/private/group/group.php @@ -90,14 +90,12 @@ class Group { * @return bool */ public function inGroup($user) { - foreach ($this->users as $cachedUser) { - if ($user->getUID() === $cachedUser->getUID()) { - return true; - } + if (isset($this->users[$user->getUID()])) { + return true; } foreach ($this->backends as $backend) { if ($backend->inGroup($user->getUID(), $this->gid)) { - $this->users[] = $user; + $this->users[$user->getUID()] = $user; return true; } }