[Form] optimized PropertyPathMapper to invoke the expensive property path less often
This commit is contained in:
parent
47a8bbdada
commit
492c99073b
@ -71,9 +71,7 @@ class PropertyPathMapper implements DataMapperInterface
|
||||
if (null !== $propertyPath && $config->getMapped() && $form->isSynchronized() && !$form->isDisabled()) {
|
||||
// If the data is identical to the value in $data, we are
|
||||
// dealing with a reference
|
||||
$isReference = $form->getData() === $propertyPath->getValue($data);
|
||||
|
||||
if (!is_object($data) || !$isReference || !$config->getByReference()) {
|
||||
if (!is_object($data) || !$config->getByReference() || $form->getData() !== $propertyPath->getValue($data)) {
|
||||
$propertyPath->setValue($data, $form->getData());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user