By removing the attempt to write if () {} else if () chains. The _c
variable is a primitive (an enum) local to this function, so its value
cannot change. All compilers in 2024 are smart enough to realize that
if (_c == QMetaObject::CreateInstance) {
...
} else if (_c == QMetaObject::ReadProperty) {
...
} else if (_c == QMetaObject::WriteProperty) {
...
} else if (_c == QMetaObject::ResetProperty) {
} else if (_c == QMetaObject::BindableProperty) {
...
}
is the same as
if (_c == QMetaObject::CreateInstance) {
...
}
if (_c == QMetaObject::ReadProperty) {
...
}
if (_c == QMetaObject::WriteProperty) {
...
}
if (_c == QMetaObject::BindableProperty) {
...
}
Drive-by not emitting some of the unnecessary property controls (which
all compilers would discard anyway).
Change-Id: Ib3e88392d7b960fbf64dfffd83ce636260ff6d7d
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 245a1ecb8badaae4979e3fbaa25e8936a85a7428)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>