better performance with slave

This commit is contained in:
Emmanuel Garette 2017-05-26 14:07:43 +02:00
parent 026179d9b7
commit 56bc9fdb1c
2 changed files with 2 additions and 3 deletions

View file

@ -229,7 +229,7 @@ class MasterSlaves(object):
else:
return value
elif index is None:
multi.append(value, setitem=False, force=True, validate=validate,
multi.append(value, setitem=False, force=True, validate=False,
force_permissive=force_permissive)
else:
multi = value

View file

@ -770,8 +770,7 @@ class Multi(list):
if 'validator' in setting_properties and validate:
session = context.cfgimpl_get_values()._p_.getsession()
fake_context = context._gen_fake_values(session)
fake_multi = fake_context.cfgimpl_get_values()._get_cached_value(
self.opt, path=self.path, validate=False)
fake_multi = Multi(list(self), weakref.ref(fake_context), self.opt, self.path)
fake_multi._setitem(index, value, validate=False)
self._validate(value, fake_context, index, True)
#assume not checking mandatory property