Browse Source

Revert "Minor optimization for DateTimeType"

This reverts commit 2d153f080c16483c8a44346b5ddfce1673263c5e. While
this minor optimization should have helped improve performance, but has
created subtle issues in at least one application.

Refs #9066
Mark Story 9 years ago
parent
commit
70c0ca3e4d
1 changed files with 1 additions and 5 deletions
  1. 1 5
      src/Database/Type/DateTimeType.php

+ 1 - 5
src/Database/Type/DateTimeType.php

@@ -122,10 +122,6 @@ class DateTimeType extends Type
             list($value) = explode('.', $value);
         }
 
-        if ($this->_datetimeInstance === null) {
-            $this->_datetimeInstance = new $this->_className;
-        }
-
         $instance = clone $this->_datetimeInstance;
 
         return $instance->modify($value);
@@ -261,7 +257,7 @@ class DateTimeType extends Type
             $class = $fallback;
         }
         $this->_className = $class;
-        $this->_datetimeInstance = null;
+        $this->_datetimeInstance = new $this->_className;
     }
 
     /**