Commit 8ee92ac4 authored by Vincent Pelletier's avatar Vincent Pelletier

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

Same for local_var.tid.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@1765 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent a6ba2d89
...@@ -568,15 +568,17 @@ class Application(object): ...@@ -568,15 +568,17 @@ class Application(object):
def tpc_vote(self, transaction): def tpc_vote(self, transaction):
"""Store current 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) raise StorageTransactionError(self, transaction)
tid = local_var.tid
user = transaction.user user = transaction.user
desc = transaction.description desc = transaction.description
ext = dumps(transaction._extension) ext = dumps(transaction._extension)
oid_list = self.local_var.data_dict.keys() oid_list = self.local_var.data_dict.keys()
# Store data on each node # Store data on each node
voted_counter = 0 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: for cell in cell_list:
logging.debug("voting object %s %s" %(cell.getAddress(), logging.debug("voting object %s %s" %(cell.getAddress(),
cell.getState())) cell.getState()))
...@@ -584,8 +586,8 @@ class Application(object): ...@@ -584,8 +586,8 @@ class Application(object):
if conn is None: if conn is None:
continue continue
self.local_var.txn_voted = False local_var.txn_voted = False
p = Packets.AskStoreTransaction(self.local_var.tid, p = Packets.AskStoreTransaction(tid,
user, desc, ext, oid_list) user, desc, ext, oid_list)
try: try:
self._askStorage(conn, p) self._askStorage(conn, p)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment