Commit 95a6d72a authored by Vincent Pelletier's avatar Vincent Pelletier

Factorise property access.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2571 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 8ffb54f6
...@@ -399,14 +399,19 @@ class TransactionManager(object): ...@@ -399,14 +399,19 @@ class TransactionManager(object):
def _unlockPending(self): def _unlockPending(self):
# unlock pending transactions # unlock pending transactions
while self._queue: queue = self._queue
uuid, tid = self._queue.pop(0) pop = queue.pop
txn = self._tid_dict.get(tid, None) insert = queue.insert
on_commit = self._on_commit
get = self._tid_dict.get
while queue:
uuid, tid = pop(0)
txn = get(tid, None)
# _queue can contain un-prepared transactions # _queue can contain un-prepared transactions
if txn is not None and txn.locked(): if txn is not None and txn.locked():
self._on_commit(tid, txn) on_commit(tid, txn)
else: else:
self._queue.insert(0, (uuid, tid)) insert(0, (uuid, tid))
break break
def abortFor(self, node): def abortFor(self, node):
......
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