Skip to content

Commit

Permalink
Don't do an assignment on every call
Browse files Browse the repository at this point in the history
  • Loading branch information
tigrang committed Mar 27, 2014
1 parent 8829e54 commit ea3d7a6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Database/TypeMapTrait.php
Expand Up @@ -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;
}
Expand Down

0 comments on commit ea3d7a6

Please sign in to comment.