[Neo-report] r1765 vincent - /trunk/neo/client/app.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Feb 16 11:18:08 CET 2010


Author: vincent
Date: Tue Feb 16 11:18:08 2010
New Revision: 1765

Log:
Avoid looking local_var up on self each time it's used.

Same for local_var.tid.

Modified:
    trunk/neo/client/app.py

Modified: trunk/neo/client/app.py
==============================================================================
--- trunk/neo/client/app.py [iso-8859-1] (original)
+++ trunk/neo/client/app.py [iso-8859-1] Tue Feb 16 11:18:08 2010
@@ -568,15 +568,17 @@
 
     def tpc_vote(self, transaction):
         """Store current transaction."""
-        if transaction is not self.local_var.txn:
+        local_var = self.local_var
+        if transaction is not local_var.txn:
             raise StorageTransactionError(self, transaction)
+        tid = local_var.tid
         user = transaction.user
         desc = transaction.description
         ext = dumps(transaction._extension)
         oid_list = self.local_var.data_dict.keys()
         # Store data on each node
         voted_counter = 0
-        cell_list = self._getCellListForTID(self.local_var.tid, writable=True)
+        cell_list = self._getCellListForTID(tid, writable=True)
         for cell in cell_list:
             logging.debug("voting object %s %s" %(cell.getAddress(),
                 cell.getState()))
@@ -584,8 +586,8 @@
             if conn is None:
                 continue
 
-            self.local_var.txn_voted = False
-            p = Packets.AskStoreTransaction(self.local_var.tid,
+            local_var.txn_voted = False
+            p = Packets.AskStoreTransaction(tid,
                     user, desc, ext, oid_list)
             try:
                 self._askStorage(conn, p)





More information about the Neo-report mailing list