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):
"""
Implicitely create a thread context if it doesn't exist.
"""
my_id = self._getID()
try:
result = self._context_dict[my_id]
return self._context_dict[self._getID()]
except KeyError:
result = self._context_dict[my_id] = self._new()
return result
return self.new()
class TransactionContainer(ContainerBase):
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