Commit 7ff8f489 authored by Vincent Pelletier's avatar Vincent Pelletier

Marginal optimisations while reading code.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@44609 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 22d303d0
...@@ -1361,9 +1361,9 @@ class Base( CopyContainer, ...@@ -1361,9 +1361,9 @@ class Base( CopyContainer,
keep_existing -- if set to 1 or True, only those properties for which keep_existing -- if set to 1 or True, only those properties for which
hasProperty is False will be updated. hasProperty is False will be updated.
""" """
key_list = kw.keys() if not kw:
if len(key_list) == 0:
return return
key_list = kw.keys()
modified_property_dict = self._v_modified_property_dict = {} modified_property_dict = self._v_modified_property_dict = {}
modified_object_dict = {} modified_object_dict = {}
...@@ -1390,14 +1390,17 @@ class Base( CopyContainer, ...@@ -1390,14 +1390,17 @@ class Base( CopyContainer,
for key in key_list: for key in key_list:
# We only change if the value is different # We only change if the value is different
# This may be very long... # This may be very long...
old_value = None if force_update:
if not force_update: update = True
old_value = None
else:
try: try:
old_value = getProperty(key, evaluate=0) old_value = getProperty(key, evaluate=0)
except TypeError: except TypeError:
old_value = getProperty(key) old_value = getProperty(key)
update = old_value != kw[key]
if old_value != kw[key] or force_update: if update:
# We keep in a thread var the previous values # We keep in a thread var the previous values
# this can be useful for interaction workflow to implement lookups # this can be useful for interaction workflow to implement lookups
# XXX If iteraction workflow script is triggered by edit and calls # XXX If iteraction workflow script is triggered by edit and calls
......
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