OSDN Git Service

avoid temporary in QMetaObject::constructor()
authorIvailo Monev <xakepa10@laimg.moc>
Wed, 8 Apr 2020 00:42:47 +0000 (00:42 +0000)
committerIvailo Monev <xakepa10@laimg.moc>
Wed, 8 Apr 2020 00:42:47 +0000 (00:42 +0000)
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
src/core/kernel/qmetaobject.cpp

index aa4243b..c0bed56 100644 (file)
@@ -723,11 +723,10 @@ int QMetaObject::indexOfClassInfo(const char *name) const
 QMetaMethod QMetaObject::constructor(int index) const
 {
     Q_ASSERT(priv(d.data)->revision >= 6);
-    int i = index;
     QMetaMethod result;
-    if (i >= 0 && i < priv(d.data)->constructorCount) {
+    if (index >= 0 && index < priv(d.data)->constructorCount) {
         result.mobj = this;
-        result.handle = priv(d.data)->constructorData + 5*i;
+        result.handle = priv(d.data)->constructorData + 5*index;
     }
     return result;
 }