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):
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 @@ class Application(object):
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)
......
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