Surface: optimize Extend::onChanged

This commit is contained in:
wmayer
2020-07-03 15:49:32 +02:00
parent 1bfd5c81cd
commit 4722571a5a

View File

@@ -161,10 +161,9 @@ void Extend::onChanged(const App::Property* prop)
lockOnChangeMutex.unlock();
std::lock_guard<std::mutex> lock(lockOnChangeMutex);
if ( ExtendUSymetric.getValue() )
if (ExtendUSymetric.getValue())
{
if (prop->getName() == ExtendUNeg.getName()
|| prop->getName() == ExtendUPos.getName())
if (prop == &ExtendUNeg || prop == &ExtendUPos)
{
auto changedValue = dynamic_cast<const App::PropertyFloat*>(prop);
if (changedValue)
@@ -174,10 +173,10 @@ void Extend::onChanged(const App::Property* prop)
}
}
}
if (ExtendVSymetric.getValue())
{
if (prop->getName() == ExtendVNeg.getName()
|| prop->getName() == ExtendVPos.getName())
if (prop == &ExtendVNeg || prop == &ExtendVPos)
{
auto changedValue = dynamic_cast<const App::PropertyFloat*>(prop);
if (changedValue)