Commit ece210ea authored by Vincent Pelletier's avatar Vincent Pelletier

Avoid a test in the inner loop.

parent 28ec6557
...@@ -240,6 +240,10 @@ class UidBuffer(TM): ...@@ -240,6 +240,10 @@ class UidBuffer(TM):
tid = get_ident() tid = get_ident()
self.temporary_buffer.setdefault(tid, []).extend(iterable) self.temporary_buffer.setdefault(tid, []).extend(iterable)
class DummyDict(dict):
def __setitem__(self, key, value):
pass
related_key_definition_cache = {} related_key_definition_cache = {}
related_key_warned_column_set = set() related_key_warned_column_set = set()
...@@ -1545,7 +1549,10 @@ class Catalog(Folder, ...@@ -1545,7 +1549,10 @@ class Catalog(Folder,
if method_id_list is None: if method_id_list is None:
method_id_list = self.sql_catalog_object_list method_id_list = self.sql_catalog_object_list
econtext = getEngine().getContext() econtext = getEngine().getContext()
argument_cache = {} if disable_cache:
argument_cache = DummyDict()
else:
argument_cache = {}
with (noReadOnlyTransactionCache if disable_cache else with (noReadOnlyTransactionCache if disable_cache else
readOnlyTransactionCache)(): readOnlyTransactionCache)():
...@@ -1646,8 +1653,7 @@ class Catalog(Folder, ...@@ -1646,8 +1653,7 @@ class Catalog(Folder,
LOG('SQLCatalog', WARNING, 'Failed to call method %s on %r' % LOG('SQLCatalog', WARNING, 'Failed to call method %s on %r' %
(arg, object), error=sys.exc_info()) (arg, object), error=sys.exc_info())
value = None value = None
if not disable_cache: argument_cache[argument_cache_key] = value
argument_cache[argument_cache_key] = value
append(value) append(value)
kw[arg] = value_list kw[arg] = value_list
......
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