refactor isCompatibleEnumTypes to remove PVS warning

This commit is contained in:
Dmitry Novik 2021-08-24 21:11:47 +03:00
parent 1984940eb6
commit 2da3893b1f

View File

@ -503,13 +503,13 @@ namespace
*/
bool isCompatibleEnumTypes(const IDataType * lhs, const IDataType * rhs)
{
WhichDataType which{lhs};
if (!which.isEnum())
return false;
IDataTypeEnum const * enum_type = dynamic_cast<IDataTypeEnum const *>(lhs);
if (!enum_type->contains(*rhs))
return false;
return enum_type->getMaximumSizeOfValueInMemory() == rhs->getMaximumSizeOfValueInMemory();
if (IDataTypeEnum const * enum_type = dynamic_cast<IDataTypeEnum const *>(lhs))
{
if (!enum_type->contains(*rhs))
return false;
return enum_type->getMaximumSizeOfValueInMemory() == rhs->getMaximumSizeOfValueInMemory();
}
return false;
}
}