From 25c332c7c449cc04f6e00911332ab534b8ce280c Mon Sep 17 00:00:00 2001 From: Jan Tvrdik Date: Thu, 5 Feb 2015 17:16:27 +0100 Subject: [PATCH] Container: optimized getService() performance --- src/DI/Container.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/DI/Container.php b/src/DI/Container.php index 7250f0d06..381a2b985 100644 --- a/src/DI/Container.php +++ b/src/DI/Container.php @@ -98,8 +98,10 @@ public function removeService($name) */ public function getService($name) { - $name = isset($this->meta[self::ALIASES][$name]) ? $this->meta[self::ALIASES][$name] : $name; if (!isset($this->registry[$name])) { + if (isset($this->meta[self::ALIASES][$name])) { + return $this->getService($this->meta[self::ALIASES][$name]); + } $this->registry[$name] = $this->createService($name); } return $this->registry[$name];