Commit 064cef58 authored by Vincent Pelletier's avatar Vincent Pelletier

client.container: Do not duplicate self.new() .

Also, saves one local variable assignment in "hit" code path.
parent 772266f2
...@@ -100,12 +100,10 @@ class ThreadContainer(ContainerBase): ...@@ -100,12 +100,10 @@ class ThreadContainer(ContainerBase):
""" """
Implicitely create a thread context if it doesn't exist. Implicitely create a thread context if it doesn't exist.
""" """
my_id = self._getID()
try: try:
result = self._context_dict[my_id] return self._context_dict[self._getID()]
except KeyError: except KeyError:
result = self._context_dict[my_id] = self._new() return self.new()
return result
class TransactionContainer(ContainerBase): class TransactionContainer(ContainerBase):
def _getID(self, txn): def _getID(self, txn):
......
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