[Erp5-report] r41610 jm - /erp5/trunk/products/ERP5/Document/SimulationMovement.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Dec 21 16:14:54 CET 2010


Author: jm
Date: Tue Dec 21 16:14:54 2010
New Revision: 41610

URL: http://svn.erp5.org?rev=41610&view=rev
Log:
small optimization (getattr only once)

Modified:
    erp5/trunk/products/ERP5/Document/SimulationMovement.py

Modified: erp5/trunk/products/ERP5/Document/SimulationMovement.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/SimulationMovement.py?rev=41610&r1=41609&r2=41610&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/SimulationMovement.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/SimulationMovement.py [utf8] Tue Dec 21 16:14:54 2010
@@ -313,10 +313,10 @@ class SimulationMovement(PropertyRecorda
     delivery_value = self.getDeliveryValue()
     if delivery_value is None:
       # If the parent is not an Applied Rule, self does not have the method.
-      if getattr(self, 'getRootAppliedRule', None) is not None:
-        ra = self.getRootAppliedRule()
-      else:
+      getRootAppliedRule = getattr(self, 'getRootAppliedRule', None)
+      if getRootAppliedRule is None:
         return None
+      ra = getRootAppliedRule()
       order = ra.getCausalityValue()
       if order is not None:
         return order



More information about the Erp5-report mailing list