Browse Source

Don't do an assignment on every call

Tigran Gabrielyan 12 years ago
parent
commit
ea3d7a625a
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/Database/TypeMapTrait.php

+ 3 - 1
src/Database/TypeMapTrait.php

@@ -34,7 +34,9 @@ trait TypeMapTrait {
  * @return this|TypeMap
  */
 	public function typeMap($typeMap = null) {
-		$this->_typeMap = ($this->_typeMap) ?: new TypeMap();
+		if (!$this->_typeMap) {
+			$this->_typeMap = new TypeMap();
+		}
 		if ($typeMap === null) {
 			return $this->_typeMap;
 		}