optimizing Tinebase_Record_Abstract::setTimezone
authorPaul Mehrer <p.mehrer@metaways.de>
Sun, 22 Dec 2013 18:25:02 +0000 (19:25 +0100)
committerPhilipp Schüle <p.schuele@metaways.de>
Mon, 23 Dec 2013 10:34:46 +0000 (11:34 +0100)
iterates over all properties and checks for is_object. Amount of is_object calls can be reduced by first evaluating for true. Approx. halfs the is_object calls.

Change-Id: I78219b3395d7107d1f53602dfa3e2447fc1b9dc5
Reviewed-on: https://gerrit.tine20.org/tine20/2679
Tested-by: jenkins user
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Tinebase/Record/Abstract.php

index 9c45776..2da69ee 100644 (file)
@@ -460,7 +460,7 @@ abstract class Tinebase_Record_Abstract implements Tinebase_Record_Interface
         
         if ($_recursive) {
             foreach ($this->_properties as $property => $value) {
-                if (is_object($value) && 
+                if ($value && is_object($value) && 
                         (in_array('Tinebase_Record_Interface', class_implements($value)) || 
                         $value instanceof Tinebase_Record_Recordset) ) {