diff --git a/lib/Doctrine/ORM/Repository/DefaultRepositoryFactory.php b/lib/Doctrine/ORM/Repository/DefaultRepositoryFactory.php
index a0564ba94..e7f0aca13 100644
--- a/lib/Doctrine/ORM/Repository/DefaultRepositoryFactory.php
+++ b/lib/Doctrine/ORM/Repository/DefaultRepositoryFactory.php
@@ -49,11 +49,7 @@ class DefaultRepositoryFactory implements RepositoryFactory
             return $this->repositoryList[$className];
         }
 
-        $repository = $this->createRepository($entityManager, $entityName);
-
-        $this->repositoryList[$className] = $repository;
-
-        return $repository;
+        return $this->repositoryList[$className] = $this->createRepository($entityManager, $entityName);
     }
 
     /**