[Pkg-owncloud-commits] [owncloud] 06/34: user Group->users as assosiative array

David Prévot taffit at moszumanska.debian.org
Thu Nov 13 19:37:12 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to annotated tag v6.0.6
in repository owncloud.

commit 5525294f9bf93cd324f62112451862465b0ff5de
Author: Robin Appelman <icewind at owncloud.com>
Date:   Wed Dec 11 16:25:41 2013 +0100

    user Group->users as assosiative array
---
 lib/private/group/group.php | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/lib/private/group/group.php b/lib/private/group/group.php
index 5d046b1..31f25f5 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;
 			}
 		}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list