Skip to content

Commit

Permalink
Don't waste memory by storing gid twice when no display name
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincent Petry committed Dec 1, 2016
1 parent d4d0ab6 commit 040c59a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/private/Group/Group.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,17 @@ public function __construct($gid, $backends, $userManager, $emitter = null, $dis
$this->backends = $backends;
$this->userManager = $userManager;
$this->emitter = $emitter;
if (is_null($displayName)) {
$this->displayName = $gid;
} else {
$this->displayName = $displayName;
}
$this->displayName = $displayName;
}

public function getGID() {
return $this->gid;
}

public function getDisplayName() {
if (is_null($this->displayName)) {
return $this->gid;
}
return $this->displayName;
}

Expand Down

0 comments on commit 040c59a

Please sign in to comment.