[Form] optimized PropertyPathMapper to invoke the expensive property path less often

This commit is contained in:
Tobias Schultze 2012-08-26 08:43:27 +02:00
parent 47a8bbdada
commit 492c99073b
1 changed files with 1 additions and 3 deletions

View File

@ -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());
}
}